expo firebase google signin gives: First argument "idToken" must be a valid string or a valid object or null

Viewed 808

https://docs.expo.io/versions/latest/sdk/google

I follow the integration guides on official website when I authenticate with google it gives me such a error

credential failed: First argument "idToken" must be a valid string or a valid object or null

_handleGoogleAuth = async () =>{
    console.log(ENV.androidClientId)
    const { type, token } = await Google.logInAsync({ 
        androidClientId: ENV.androidClientId,
        iosClientId:ENV.iosClientId,
        behavior: Platform.OS === 'ios' ? 'web' : 'system'
    })
    console.log(type+'type')

    if (type == 'success') {

      const credential = firebase.auth.GoogleAuthProvider.credential(token)
      console.log(credential.idToken)

      firebase.auth().signInWithCredential(credential).catch((error) => {
        console.log(error)
      })
    }

}
1 Answers

There's a known error with the expo-google-signin library where idToken and sometimes accessToken are returned as undefined.

It might stretch over to expo Google as well.

Related