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

The UIWindowScene for the returned window was not in the foreground active state - iOS #462

Open
6 tasks done
kane-knowby opened this issue Jun 6, 2024 · 0 comments
Open
6 tasks done

Comments

@kane-knowby
Copy link

Checklist

Description

If you call the web authentication login method too fast after app is brought to the foreground, the login fails with the following error:

WebAuthenticationException (OTHER: An unexpected error occurred. CAUSE: 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.}) [K] #0 MethodChannelAuth0FlutterWebAuth.invokeRequest (package:auth0_flutter_platform_interface/src/method_channel_auth0_flutter_web_auth.dart:45:7) <asynchronous suspension> #1 MethodChannelAuth0FlutterWebAuth.login (package:auth0_flutter_platform_interface/src/method_channel_auth0_flutter_web_auth.dart:21:9) <asynchronous suspension> #2 WebAuthentication.login (package:auth0_flutter/src/mobile/web_authentication.dart:89:25) <asynchronous suspension> #3 AuthService.acceptInvite (package:knowby_pro/features/auth/state/auth_service.dart:368:27) <asynchronous suspension>

We are only able to get around this by adding a fake delay before calling the login method.

Reproduction

  1. Create a new flutter route in the example which calls web auth login as soon as the route loads
  2. Deeplink to that route when app is in the background (iOS)

Additional context

No response

auth0_flutter version

1.7.2

Flutter version

3.22.0

Platform

iOS

Platform version(s)

iOS 17.5

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

No branches or pull requests

1 participant