-
Notifications
You must be signed in to change notification settings - Fork 114
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
Crash immediately after starting on iOS in SwiftFlutterWebAuthPlugin.handle #182
Comments
Experiencing the same issue here.
We partially worked around the crash by adding a login button instead of automatically logging in on startup, but it still crashes occasionally. |
I am seeing this issue on app startup too. The code that is generated for SwiftFlutterWebAuth2Plugin specifies a completionHandler that assumes a session exists. It crashes on this line: (sessionToKeepAlive as! ASWebAuthenticationSession).cancel() The problem is that a prior session was NOT established yet. The completionHandler is being called with an error related to app window management: Error Domain=com.apple.AuthenticationServices.WebAuthenticationSession Code=3 "The UIWindowScene for the returned window was not in the foreground active state." UserInfo={NSDebugDescription=The UIWindowScene for the returned window was not in the foreground active state.} A fix that works for me is to determine when the app actually reports that it is in foreground, and only attempt a network operation at that point. I used a solution that is specified here: https://stackoverflow.com/questions/51835039/how-do-i-check-if-the-flutter-application-is-in-the-foreground-or-not (UPDATE: This fix does not work on all devices, still looking for a workaround for this limitation) (SECOND UPDATE: I was able to fix it following suggestions here, but implementing |
Similar issue Thread 0 name: Dispatch queue: com.apple.main-thread |
Works perfectly well on Android.
crashlog.txt
oauth2_client: ^3.2.2
Since this is some kind of null reference exception (or "unpacking-asserted-not-null value which is actually null") kind of error, maybe there is now a version mismatch between this and the underlying plugin, and we feed it something which is not a mandatory input in oauth2_client but (now) is in one of the underlying functions?
The text was updated successfully, but these errors were encountered: