反应本机应用程序,firbase,谷歌登录,开发人员错误

时间:2019-06-17 16:02:10

标签: android reactjs firebase react-native

我做了一个react-native项目。我正在使用Google Firebase身份验证。但是,当我使用Google帐户登录时,收到了开发人员错误。 顺便说一句关于授权的消息正在发送到我的电子邮件中

我已经研究并在我的debug.keystore中发现了麻烦。我ve added my sha1到Firebase控制台的键,但是错误仍然存​​在。

HomeScreen.js:39 Message Error: DEVELOPER_ERROR
    at createErrorFromErrorData (NativeModules.js:146)
    at NativeModules.js:95
    at MessageQueue.__invokeCallback (MessageQueue.js:414)
    at MessageQueue.js:127
    at MessageQueue.__guard (MessageQueue.js:314)
    at MessageQueue.invokeCallbackAndReturnFlushedQueue (MessageQueue.js:126)
    at debuggerWorker.js:72

这是我的身份验证方法:

_signIn = async () => {
  //Prompts a modal to let the user sign in into your application.
  try {
    await GoogleSignin.hasPlayServices({
      //Check if device has Google Play Services installed.
      //Always resolves to true on iOS.
      showPlayServicesUpdateDialog: true
    });
    const userInfo = await GoogleSignin.signIn();
    console.log("User Info --> ", userInfo);
    this.setState({ userInfo: userInfo });
  } catch (error) {
    console.log("Message", error);
    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");
    }
  }
};

我想我的sha1键或Android Studio设置有问题。

如何解决?

0 个答案:

没有答案