Describe the bug
When using Google Sign-In SDK on iOS, if the user locks their device or the app transitions to background during the authentication flow (while ASWebAuthenticationSession is active), the GIDSignInCompletion block is never called. This leaves the app in an indefinite loading/blocked state with no way to detect that the session was interrupted or cancelled by the OS.
To Reproduce
- Initiate Google Sign-In flow in an iOS app
- Wait for the
ASWebAuthenticationSession system prompt to appear
- Lock the device before completing authentication
- Unlock the device and return to the app
- Observe that the
GIDSignInCompletion block is never called (no success, no error, no cancellation callback) and the ASWebAuthenticationSession alert is dismissed.
Expected behavior
The GIDSignInCompletion block should be invoked with either:
- A cancellation result/error indicating the session was interrupted, OR
- A property that allows detection of this interrupted state
This would allow the host app to reset its UI state (e.g., hide loading indicators, re-enable the sign-in button).
Screenshots
N/A.
Environment
- Device: iPhone (various models)
- OS: iOS (tested on iOS26, iOS18)
- SDK: Google Sign-In SDK for iOS
Additional context
This issue stems from how iOS handles ASWebAuthenticationSession interruptions. When the device is locked or the app goes to background, iOS may dismiss the authentication prompt without reliably delivering a cancellation callback to the SDK.
A similar issue has been reported by multiple users in the AppAuth-iOS repository: openid/AppAuth-iOS#468. A fix for the SDK is observing the app's background/foreground state transitions and invoking the completion block if a previously active session was found. We recommend Google Sign-In SDK implement a similar mechanism to detect interrupted sessions and return an appropriate callback to the host application.
Describe the bug
When using Google Sign-In SDK on iOS, if the user locks their device or the app transitions to background during the authentication flow (while
ASWebAuthenticationSessionis active), theGIDSignInCompletionblock is never called. This leaves the app in an indefinite loading/blocked state with no way to detect that the session was interrupted or cancelled by the OS.To Reproduce
ASWebAuthenticationSessionsystem prompt to appearGIDSignInCompletionblock is never called (no success, no error, no cancellation callback) and theASWebAuthenticationSessionalert is dismissed.Expected behavior
The
GIDSignInCompletionblock should be invoked with either:This would allow the host app to reset its UI state (e.g., hide loading indicators, re-enable the sign-in button).
Screenshots
N/A.
Environment
Additional context
This issue stems from how iOS handles
ASWebAuthenticationSessioninterruptions. When the device is locked or the app goes to background, iOS may dismiss the authentication prompt without reliably delivering a cancellation callback to the SDK.A similar issue has been reported by multiple users in the AppAuth-iOS repository: openid/AppAuth-iOS#468. A fix for the SDK is observing the app's background/foreground state transitions and invoking the completion block if a previously active session was found. We recommend Google Sign-In SDK implement a similar mechanism to detect interrupted sessions and return an appropriate callback to the host application.