使用电话号码登录时令牌无效

时间:2020-02-21 09:59:53

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

我有一个移动应用程序(React Native),可以使用电话号码登录

在Android版本中,一切正常

问题出在iOS上:

  onSignIn() {
    const { code, phoneNumber } = this.state;
    const newNumber = '+' + code + phoneNumber;
    if (newNumber.length > 10) {
      firebase
        .auth()
        .signInWithPhoneNumber(newNumber)
        .then(confirmResult => {
          this.setState({ result: confirmResult });
          const navigateAction = NavigationActions.navigate({
            routeName: 'SecurityCode',
            params: { phoneAuthResponse: confirmResult },
          });
          this.props.navigation.dispatch(navigateAction);
        })
        .catch(error => {
          if (error.message === 'TOO SHORT') {
            alert('Please enter a valid phone number');
          } else {
            alert(error.message);
          }
        });
    } else {
      alert('Please Enter Your Number');
    }
  }

一个模式窗口打开,显示类似屏幕上的信息

enter image description here

在某个地方逐步编写了应该满足的条件吗?在TestFlight上进行测试

0 个答案:

没有答案