Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Authentication works in 0.4.0, but not in 0.4.1 - AQUIRE_ROOT_VIEW_CONTROLLER_FAILED #135

Open
Will5 opened this issue Aug 16, 2022 · 2 comments · Fixed by ThexXTURBOXx/flutter_web_auth_2#28

Comments

@Will5
Copy link

Will5 commented Aug 16, 2022

I have an example app which authenticates with multiple identity providers, including Auth0 and Okta. Using 0.4.0, both buttons work on Android and iOS, but using 0.4.1, one button always results in an AQUIRE_ROOT_VIEW_CONTROLLER_FAILED error on iOS. For now, I will use 0.4.0, but I'm concerned I won't be able to update in the future.

As I understand it, the change was to support Flutter apps with "add to app" use cases, but I think this may have broken for "pure" Flutter apps. I'm having trouble debugging the plugin, but I wonder if it should check for UIApplication.shared.delegate?.window??.rootViewController as? FlutterViewController first, and then check for UIApplication.shared.keyWindow?.rootViewController.

@LinusU
Copy link
Owner

LinusU commented Nov 1, 2022

This is indeed unfortunate and should be fixed!

As I understand it, the change was to support Flutter apps with "add to app" use cases, but I think this may have broken for "pure" Flutter apps. I'm having trouble debugging the plugin, but I wonder if it should check for UIApplication.shared.delegate?.window??.rootViewController as? FlutterViewController first, and then check for UIApplication.shared.keyWindow?.rootViewController.

Did you try to make this change? Did it fix the problem? Would you be able to submit a PR with the change?

@Will5
Copy link
Author

Will5 commented Nov 17, 2022

I was able to test this change in my Flutter application, so I submitted a PR, but I did not test the other use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants