Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
279 views
in Technique[技术] by (71.8m points)

React-native : GoogleSignIt ok but not display in authGmail in Firebase is empty

I use the method to check the react-native ( react-native-community/google-signin ).

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

 // IHM 
     Button
          title="Google Sign-In"
          onPress={() => this._onGoogleButtonPressAndroid()}
       />

 // JS method 
 _onGoogleButtonPressAndroid() {
return new Promise((resolve, reject) => {
  GoogleSignin.signIn()
    .then( userInfo => {
      const { idToken } = userInfo
      const googleCredential = auth.GoogleAuthProvider.credential(idToken);
      this.props.navigation.navigate('Root')
      resolve(true)
    }).catch(err => {
      reject(err)
    })
})

}

I click on the button, I see a prompt, I select a gmail. The redirection is ok

Second step.

I delete the mail in firebase, I restart my app, I restart the same process, I click on the button, I don't see a prompt. The redirection is ok but i don't see the mail ( authentification page ) in firebase.

Firebase SignIn without problem. It's normal ? My code is not correct ?

Thanks for help

capture of Gmail Auth


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You must have to add SHA-1 Key to your Firebase project that is needed to Google Sign In and Phone Auth.

Please refere React Native Firebase for how to generate and SHA-1 key add to your project.

https://rnfirebase.io/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...