1
votes

I am using react-native 0.60.5, with firebase authentication (using package react-native-firebase and react-native-google-signin).

Everything looks good to me and the google sign return an object with the user logged in, but the idToken is always null. I need to get the idToken to perform the authentication in firebase.

import { GoogleSignin } from 'react-native-google-signin';

export const googleLogin = async () => {
    GoogleSignin.configure();
    const userInfo = await GoogleSignin.signIn();
    //here we have the issue. userInfo cotains all google user informations except the idToken
    //userInfo.idToken is null
}

how can I fix the google-sign-in to return the idToken?

1
Did you solve this? I am having the same issueMaxPower
yeah, I found some misconfigurations in google console. I recreated the configs and worked fineLeandro Lima

1 Answers

1
votes

Add the web client id which is availble in Firebase authentication/signInmethod/Google:

function configureGoogleSign() {

    GoogleSignin.configure({
        webClientId: WEB_CLIENT_ID,
        offlineAccess: false
    })
}

This is working for me.