【问题标题】:React-Native Firebase Phone Auth freezes iPhoneReact-Native Firebase Phone Auth 冻结 iPhone
【发布时间】:2018-08-14 15:12:59
【问题描述】:

我想在 react-native 中通过 phoneNumber 让用户登录。在 Android 上,这段代码 sn-p 工作得很好。但是在 iOS 上,当我启动此功能时,模拟器总是冻结。我正在尝试使用此代码 Auth-Example 我正在使用 react-native-firebase 库。

  openPhoneVerification() {
    firebase
      .auth()
      .signInWithPhoneNumber(this.state.phoneNumber)
      .then(confirmResult =>
        this.props.navigation.navigate("PhoneVerification", {
          confirmResult
        })
      )
      // Wrong number - https://firebase.google.com/docs/reference/js/firebase.auth.Auth#signInWithPhoneNumber
      .catch(error =>
        Alert.alert(
          "Number not valid",
          "Please check your number and type in again",
          [
            {
              text: "OK",
              style: "cancel"
            }
          ],
          { cancelable: true }
        )
      );
  }

【问题讨论】:

  • 您找到解决方案了吗?我遇到了同样的问题,想知道这是否与我的应用程序没有提示用户通过 testflight 启用推送通知这一事实有关?

标签: ios firebase react-native firebase-authentication react-native-firebase


【解决方案1】:

遇到相同问题的任何人的解决方案:

确保为您的 APN 指定的名称与应用名称匹配

【讨论】:

  • 你能再解释一下吗?
  • @Ethrak 我会尽力而为,因为我已经有将近一年没有使用 firebase 并且不再可以访问 repo(这是我在 9 月份完成的一份合同)。我认为我遇到的问题是我错误配置了我的 APN:firebase.google.com/docs/cloud-messaging/ios/certs?authuser=0 我在 APN 中列出的名称与我在我的 RN 应用中的应用名称不同。希望对您有所帮助,如果它最终解决了您的问题,请告诉我
猜你喜欢
  • 1970-01-01
  • 2018-12-24
  • 1970-01-01
  • 2019-12-23
  • 2021-04-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-06-13
相关资源
最近更新 更多