flutter_web_auth icon indicating copy to clipboard operation
flutter_web_auth copied to clipboard

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

Open Will5 opened this issue 3 years ago • 2 comments

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.

Will5 avatar Aug 16 '22 14:08 Will5

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?

LinusU avatar Nov 01 '22 09:11 LinusU

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.

Will5 avatar Nov 17 '22 21:11 Will5