Firebase Auth在独立应用程序中不起作用

时间:2020-08-06 12:40:18

标签: javascript react-native firebase-authentication expo yup

我在Expo / React本机应用程序中使用Firebase Auth。身份验证可以在本地完美运行,但是在生产环境(从Play商店下载的APK)中,用户无法创建帐户。

最奇怪的是,几个用户在再次尝试后能够创建一个帐户(一个用户说她关闭了该应用程序,然后尝试使用另一封电子邮件再次进行注册,然后为她工作)。

以下是与注册相关的代码:

handleRegister = async ({ name, email, password }) => {
    this.setState({ inProgress: true });
    try {
      const credentials = await this.createUser(email, password);
      await this.saveUser(name, email, password, credentials.user.uid);
      this.updateProfile(credentials, name);
      this.setState({ inProgress: false });
    } catch (error) {
      this.setState({ errorMessage: error.message });
    }
  };

  createUser = async (email, password) => {
    return firebase.auth().createUserWithEmailAndPassword(email, password);
  };

0 个答案:

没有答案