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

Add signInFailed check to prevent hanging on hot reload. #150

Merged

Conversation

theLee3
Copy link
Collaborator

@theLee3 theLee3 commented Jan 24, 2024

Due to Game Center's authentication implementation, the authenticateHandler does nothing if called again after a user cancels sign in if the app never left the foreground. This can lead to hanging of the app if the signIn call is awaited.

While it can generally fall upon the developer to account for this case in Flutter, a situation occurs when dealing with hot reloads that the developer cannot account for.

This PR adds a check for a previous failed sign in attempt to the Auth class via Swift's conditional debug compilation to resolve this issue. Release builds are unaffected.

Copy link
Owner

@Abedalkareem Abedalkareem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@theLee3 theLee3 merged commit 0e842cb into Abedalkareem:develop Jan 26, 2024
1 check failed
@theLee3 theLee3 deleted the fix-game-center-sign-in-hanging branch January 26, 2024 17:32
@theLee3 theLee3 restored the fix-game-center-sign-in-hanging branch January 26, 2024 20:01
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

Successfully merging this pull request may close these issues.

2 participants