React-Native Firebase Phone Auth冻结了iPhone

时间:2018-03-06 17:04:38

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

我想通过phoneNumber以react-native身份登录用户。在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 }
        )
      );
  }

1 个答案:

答案 0 :(得分:0)

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

确保提供给您的APN的名称与应用程序名称相符