I am using google_sign_in plug in.
It is working good. but I have a problem.
I need to send idToken to backend server to verify a user.
But IdToken is null from google sign in response.
code is simple
final GoogleSignInAccount googleUser = await _googleSignIn.signIn();
final GoogleSignInAuthentication googleAuth =
await googleUser.authentication;
print("Printing google user info");
print(googleAuth.accessToken);
print(googleAuth.idToken);
print(googleUser.displayName);
Other properties have a correct value. but idToken is null
I googled for this and says that I need to web client id.
So I did
final _googleSignIn = GoogleSignIn(clientId: webClientId);
Can you guys help?
Am I missing something?
https://firebase.google.com/docs/flutter/setup
I faced with this Problem for two days and finally. (in my case) this solution works.
https://firebase.flutter.dev/docs/installation/android#installing-your-firebase-configuration-file
adding com.google.gms:google-services
as a dependency inside of the android/build.gradle
dependencies {
// ... other dependencies
classpath 'com.google.gms:google-services:4.3.8'
}
}
adding apply plugin: 'com.google.gms.google-services'
in /android/app/build.gradle
apply plugin: 'com.google.gms.google-services'