小编Raj*_*v K的帖子

React Native firebase.auth.RecaptchaVerifier

如何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)

firebase react-native firebase-authentication

5
推荐指数
1
解决办法
1326
查看次数