iOS/macOS: distinct sign_in_unavailable error code when the sign-in UI won't present - #237
Open
pdurasie wants to merge 1 commit into
Open
Conversation
…n't present On iOS/macOS, once the authentication handler has been set and the player is still not authenticated, GameKit will not present the sign-in UI again from the app. The usual cause is that Game Center is turned off or restricted in the device's Settings, or no account is signed in there — something the user can only resolve in Settings, not by retrying in-app. (No sign-in sheet is necessarily shown first: with Game Center disabled the initial `signIn` resolves with an error and never presents UI; the next call lands in this branch.) The plugin previously surfaced this as `failed_to_authenticate`, making it indistinguishable from a normal failed/declined attempt that the user can retry. Add a dedicated `sign_in_unavailable` PluginError and return it from that branch so apps can tell "the user can retry" apart from "send the user to device Settings" and route accordingly. Android is untouched; the Dart interface is unchanged (this only refines the error code string carried by the existing PlatformException). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
RealMeeseeks
approved these changes
Jun 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a separate error code for iOS when the sign-in UI won't present, so that client apps can distinguish between "The user saw the modal and closed it without signing in" and "The modal didn't show".
As an example for what that's useful: In my app I have a button for the user to sign into Game Center / Google Play. The Game Center modal won't show when it's been closed once already or when Game Center is switched off in the settings. In that case, I show a dialog directing the user to navigate to the settings and activating Game Center there.
For Android it's not necessary, because from my tests, the sign in UI would show every time, no matter how many times it's been declined already.