Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native google sign in failed . Error code 10

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 enter image description here

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

like image 696
user7747472 Avatar asked Jul 26 '26 13:07

user7747472


1 Answers

You Should go to the Google Play Console and open Your App then click on app integrity which come under Setup.enter image description here then click on App signing and copy SHA-1 fingerprint.
Now got to firebase open your app project setting enter image description here now click on add fingerprint now pest that SHA-1 key and save. Now your google sing in will work.

like image 92
Rajesh Senapati Avatar answered Jul 29 '26 04:07

Rajesh Senapati