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
feat(auth, apple): Game Center sign-in support #12228
Conversation
# Conflicts: # packages/firebase_auth/firebase_auth/lib/firebase_auth.dart
packages/firebase_auth/firebase_auth/ios/Classes/FLTFirebaseAuthPlugin.m
Outdated
Show resolved
Hide resolved
- (void)getFIRAuthCredentialFromArguments:(NSDictionary *)arguments | ||
app:(AuthPigeonFirebaseApp *)app | ||
completion:(void (^)(FIRAuthCredential *credential, | ||
NSError *error))completion { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any Pigeon related changes on the Dart part, is there some files missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is internal to the plugin and isn't part of Pigeon API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice didn't realise thanks :)
Description
I've had to change the way we get the AuthCredential on Apple platforms. Game Center credential is different to the other providers. It requires a callback to receive. See link: https://firebase.google.com/docs/auth/ios/game-center#authenticate_with_firebase
Here is the snippet:
Previously, we called a synchronous method to get the credential: https://github.com/firebase/flutterfire/blob/master/packages/firebase_auth/firebase_auth/ios/Classes/FLTFirebaseAuthPlugin.m#L641C33-L641C66
But I had to make this a callback to allow for Game Center credential retrieval: https://github.com/firebase/flutterfire/pull/12228/files#diff-926b26fe3f9119fb3548066f1b05028306ff8766f9a04abba0fefdb5dac5c0b2R642-R645
This method is used for
signInWithCredential
,linkWithCredential()
,reauthenticateWithCredential()
&updatePhoneNumber()
API which will allow the user to call these methodssignInWithCredential
,linkWithCredential()
,reauthenticateWithCredential()
with Game Center credential.Testing Game Center sign-in
Tested signInWithCredential(), linkWithCredential() & reauthenticateWithCredential()
Related Issues
closes #12191
closes #9441
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
).This will ensure a smooth and quick review process. Updating the
pubspec.yaml
and changelogs is not required.///
).melos run analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?