如何在 React Native Firebase 的 Firebase 身份验证中避免重新验证码

时间:2021-02-27 08:11:56

标签: firebase react-native firebase-authentication recaptcha invisible-recaptcha

我从 react-native firebase 安装 firebase

# Using npm
npm install --save @react-native-firebase/app

yarn add @react-native-firebase/auth

向用户号码发送OTP的代码:

    async signUpOTP(obj) {
      console.log('signInWithPhoneNumber', obj);
      const { number, pin, confirmPin } = this.state
      let prefix = '+92' + number;
      auth().signInWithPhoneNumber(prefix)
        .then((confirmationResult) => {
          AsyncStorage.setItem('@signItem', JSON.stringify(obj));
          this.props.navigation.navigate('signupcode', { 'confirmationResult': confirmationResult, 'number': number, 'pin': pin, 'confirmPin': confirmPin })
          this.setState({ visible: false });
        }).catch((error) => {
          console.log(error, 'catch me');
          let invalidError = 'Invalid Number';
          toastMsg(invalidError)
          this.setState({ visible: false });
        });
    }

但是,它显示的是重新验证码屏幕而不是发送 OTP 代码

enter image description here

有什么办法可以避免这个 Recaptcha 屏幕吗?

0 个答案:

没有答案