2

我想在 react-native 中通过 phoneNumber 让用户登录。在 Android 上,此代码片段运行良好。但是在 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 }
        )
      );
  }
4

1 回答 1

-1

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

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

于 2019-05-24T17:57:08.083 回答