Реактивный родной Google-вход не работает - PullRequest
0 голосов
/ 11 марта 2020

После того, как GoogleSignin.hasPlayServices () и выберите учетную запись Google, на моей консоли отображается сообщение DEVELOPER_ERROR. Я новичок, чтобы реагировать на нативную, может ли кто-нибудь помочь мне решить эту проблему. Я не использую пожарную базу.

`<GoogleSigninButton
          style={{ width: 312, height: 48,alignSelf:'center',justifyContent:'center' }}
          size={GoogleSigninButton.Size.Wide}
          color={GoogleSigninButton.Color.Dark}
          onPress={this._signIn}
        />
GoogleSignin.configure({
  //It is mandatory to call this method before attempting to call signIn()
  scopes: ['https://www.googleapis.com/auth/drive.readonly'],
  // Repleace with your webClientId generated from Firebase console
  webClientId: "sdfghjmk,lfrghjklcvbnm",
});
//Check if user is already signed in
this._isSignedIn();}
_isSignedIn = async () => {
const isSignedIn = await GoogleSignin.isSignedIn();
if (isSignedIn) {
  alert('User is already signed in');
  //Get the User details as user is already signed in
  this._getCurrentUserInfo();
} else {
  //alert("Please Login");
  console.log('Please Login');
}
this.setState({ gettingLoginStatus: false });
  };
_signIn = async () => {
//Prompts a modal to let the user sign in into your application.
try {
  console.log("showPlayServicesUpdateDialog......")
  await GoogleSignin.hasPlayServices();
  console.log("showPlayServicesUpdateDialog......")
**//up to this is working....after this getting error like DEVELOPER_ERROR**
  const userInfo = await GoogleSignin.signIn();
  console.log('User Info --> ', userInfo);
  this.setState({ userInfo: userInfo });
} catch (error) {
  console.log('Message', error.message);
  if (error.code === statusCodes.SIGN_IN_CANCELLED) {
    console.log('User Cancelled the Login Flow');
  } else if (error.code === statusCodes.IN_PROGRESS) {
    console.log('Signing In');
  } else if (error.code === statusCodes.PLAY_SERVICES_NOT_AVAILABLE) {
    console.log('Play Services Not Available or Outdated');
  } else {
    console.log('Some Other Error Happened');
  }
}
};`
...