Open abraham opened 5 years ago
Hi, i was try to you app, and got the this error. I have one question. Must i had registered user into my firebase or this method make registering users?
hi @abraham , signInWithGoogle
is gone,
ref: https://github.com/flutter/flutter/issues/27133#issuecomment-457858951
we can use it like this:
Future<String> _testSignInWithGoogle() async {
final GoogleSignInAccount googleUser = await _googleSignIn.signIn();
final GoogleSignInAuthentication googleAuth =
await googleUser.authentication;
final AuthCredential credential = GoogleAuthProvider.getCredential(
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
);
final FirebaseUser user = await _auth.signInWithCredential(credential);
assert(user.email != null);
assert(user.displayName != null);
assert(!user.isAnonymous);
assert(await user.getIdToken() != null);
final FirebaseUser currentUser = await _auth.currentUser();
assert(user.uid == currentUser.uid);
return 'signInWithGoogle succeeded: $user';
}
@geminiyellow Thanks for the notice.
In
Auth#signInWithGoogle
, handlegoogleSignIn.signIn
returning null, or a user clicking cancel (and any other likely to happen failures). If a failure happens then the users should probably be shown an error snackbar.Related #49.
Methods that are likely to fail:
Relevant file: https://github.com/abraham/birb/pull/44/files#diff-122192ef8946fb1a2ce64cd05629c825R16