I am trying to add google sign in in react native application. I followed all the steps in the official doccument. Everything working fine but after signing in it through error saying
WRONG SIGNIN {"name":"GoogleSignInError","code":10}
My sign in page is like this.
import {GoogleSignin, GoogleSigninButton} from 'react-native-google-signin';
componentDidMount(){
GoogleSignin.hasPlayServices({ autoResolve: true }).then(() => {
// play services are available. can now configure library
}).catch((err) => {
console.log("Play services error", err.code, err.message);
});
GoogleSignin.configure({
scopes: ["https://www.googleapis.com/auth/drive.readonly"],//Even if i remove this the thing is same
webClientId: "********-**********.apps.googleusercontent.com",
}).then(() => {
});
}
googleSignIn=()=>{
GoogleSignin.signIn()
.then((user) => {
console.log(user);
})
.catch((err) => {
console.log('WRONG SIGNIN error', err);
})
.done();
};
//Google button
<Button onPress={()=>this.googleSignIn()}>
<Icon style={styles.googleIcon} name="google-plus" type="FontAwesome"/>
</Button>
My google developer console setup is like this

I tried to check the issue on the github issu tracer and tried their solution but no luck. Can anyone please tell me where i am doing wrong? As you can see i am using example code of react native google signin
You Should go to the Google Play Console and open Your App then click on app integrity which come under Setup.
then click on App signing and copy SHA-1 fingerprint.
Now got to firebase open your app project setting
now click on add fingerprint now pest that SHA-1 key and save.
Now your google sing in will work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With