ThexXTURBOXx / flutter_web_auth_2

Flutter plugin for authenticating a user with a web service
https://pub.dev/packages/flutter_web_auth_2
MIT License
51 stars 50 forks source link

[MacOS] PlatformExeption: Failed to aquire root FlutterViewController #10

Closed edeuss closed 1 year ago

edeuss commented 2 years ago

Describe the bug

Getting a PlatformExeption from running FlutterWebAuth2.authenticate on a mac.

Device (please complete the following information!)

Code

try {
      final result = await FlutterWebAuth2.authenticate(
        url:
            "https://example.com",
        callbackUrlScheme: "example",
      );
} catch (error) {
      print(error);
}
ThexXTURBOXx commented 2 years ago

The full error message is missing. Also, please try to apply the fixed Andrei and I noted in #9

ThexXTURBOXx commented 1 year ago

I tagged this PR as being part of Hacktoberfest. So, if someone is able to fix and properly test this issue, he is one step closer to completing Hacktoberfest 2022 :)

jonasbark commented 1 year ago

For me, it always happens when the Flutter app is not in the foreground while attempting to run authenticate. E.g. launch the app, put it in the background, then call authenticate => crash

Adam-Langley commented 1 year ago

Also fixed by e89919253da91f3e860f23f8e545d33a66b455e3

ThexXTURBOXx commented 1 year ago

@Adam-Langley Thanks for letting me know! In case someone has more problems with this, I can reopen the issue!