-
Notifications
You must be signed in to change notification settings - Fork 213
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
WebAuth never opens safari on iOS #84
Comments
Ah, i've found another bit. During login, we display a Modal that shows "logging in" if i disable that modal (which i supect is using RCTModalHostViewController) then the page opens as expected every time without any code changes. very strange. |
Sounds like you already have the solution, dismiss your modal before calling WebAuth. |
I'm having a similar issue. In my use case I have a tabbed application (with react-native-navigation) and when the user isn't authenticated (the first time they launch the app or when the JWT is not valid anymore) I'd like to show the login in a modal. We have a multi-tenant solution that requires them to first enter their account name and then logging in with Auth0. When I try to authenticate with Auth0 the webauth doesn't open and I get this Warning: Attempt to present SFSafariViewController on RCCTabBarController whose view is not in the window hierarchy @cocojoe |
OK have made PR to ensure the SFSafariViewController is presented from the topmost view controller. @stefanedberg @sebirdman please can you try #89 and report back. Thanks |
Solved my use case. Works as expected, thanks @cocojoe. |
During testing I saw this issue on debug builds and thought nothing of it (worked in release, so all seems good right?) However, I now have one of my testers reporting the same issue on a release build:
Here is the warning i see in xcode:
Warning: Attempt to present <SFSafariViewController: 0x102363bc0> on <UIViewController: 0x10241ea00> which is already presenting <RCTModalHostViewController: 0x102337990>
Interestingly, if I avoid using SFSafariViewControler and instead do:
sebirdman@b439e1f
then the page opens and login works as expected.
I'm very new to iOS development, maybe there's an easier fix for the above warning or a particular reason SFSafariViewController was chosen over just openURL?
The text was updated successfully, but these errors were encountered: