Google sign in works when testing on the emulator and a real device, however, in production it doesn't work. I have added the SHA 1 key to my Firestore project.
How would I fix this?
Future<User> googleSignIn() async {
try {
GoogleSignInAccount googleSignInAccount = await Global.googleSignIn.signIn();
GoogleSignInAuthentication googleAuth =
await googleSignInAccount.authentication;
final AuthCredential credential = GoogleAuthProvider.credential(
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
);
UserCredential result = await Global.fbAuth.signInWithCredential(credential);
User user = result.user;
updateUserData(user);
return user;
} catch (error) {
print(error);
return null;
}
}
onPressed: () async {
showDialogue(context);
var user = await loginMethod();
if (user != null) {
hideProgressDialogue(context);
Navigator.pushReplacementNamed(context, SharedStrings.userInfoPath);
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now,
// so `flutter run --release` works.
signingConfig signingConfigs.release
}
