-
Notifications
You must be signed in to change notification settings - Fork 838
Description
Describe the bug
On devices running iOS 13, whenever the browser (ASWebAuthenticationSession) is about to be displayed, the system fires the usual 'sign-in' alert. If another event pops to foreground (call, user locks the phone, etc...), upon returning the presentingViewController is correctly displayed but the alert is not visible anymore. In this scenario, the view is left idle waiting for the dialog to complete and the browser to be launched without any additional notification to the app.
To Reproduce
Steps to reproduce the behavior:
- Get to a
UIViewControllerand initiate an auth process callingauthStateByPresentingAuthorizationRequest:presentingViewController:callback: - System 'sign-in' alert is displayed
- Lock the device
- Unlock it
UIViewControlleris visible but the 'sign-in' alert is not
Expected behavior
Either the alert should show up when the app becomes active again (e.g. phone is unlocked), or the app should somehow be notified so that we can cancel the previous attempt and launch a new one.
Test device:
- Device: iPhone SE
- OS: iOS 13.2
- Version: AppAuth-iOS tag
1.2.0
Additional context
Exploring app lifecycle callbacks the following behavior has been observed:
- Whenever the alert is displayed
applicationWillResignActiveis called. Afterwards, when locking the phone,applicationDidEnterBackgroundis fired. Then, upon unlocking the device,applicationWillEnterForegroundandapplicationDidBecomeActiveare called back to back. - In any regular
UIViewControllerif the user locks the device,applicationWillResignActiveandapplicationDidEnterBackgroundare called back to back. If then unlocked, behavior remains same as before.