React Native firebase.auth.RecaptchaVerifier

Raj*_*v K 5 firebase react-native firebase-authentication

如何firebase.auth.RecaptchaVerifier使用firebase web方法设置in react native来验证电话号码并通过在设备上接收OTP进行身份验证.使用某些方法但不能在移动设备上工作.

使用Web方法进行原生反应的代码:

var appVerifier = firebase.auth.RecaptchaVerifier;
// window.recaptchaVerifier =
//   new firebase.auth.RecaptchaVerifier('recaptcha-container');

firebase.auth().signInWithPhoneNumber('+919843191338', appVerifier)
    .then(function (confirmationResult) {
        Alert.alert(confirmationResult);
        window.confirmationResult = confirmationResult;
    }).catch(function (error) {
        // Error; SMS not sent
        // ...
    });
Run Code Online (Sandbox Code Playgroud)

Bha*_*iya 0

您可以通过启用 SafetyNet API 来启用自动验证

检查此以获取详细信息: https ://firebase.google.com/docs/auth/android/phone-auth