小编Bar*_*ske的帖子

错误:verifier._reset 不是函数。当尝试使用 firebase 使用手机登录时,请反应本机和 Expo

我正在尝试在 mu React 本机应用程序中实现电话登录,但出现以下错误:

verifier._reset is not a function. (In 'verifier._reset()', 'verifier._reset' is undefined)
at http://192.168.1.2:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false&minify=false:126633:27 in <unknown>
at node_modules/tslib/tslib.js:60:8 in createExporter
at node_modules/tslib/tslib.js:18:0 in <global>
at http://192.168.1.2:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false&minify=false:116838:35 in rejected
Run Code Online (Sandbox Code Playgroud)

这就是我尝试实现签名的方式:


const SignUp = () => {
    const [phoneNumber, setPhoneNumber] = useState("")
    const recaptchaVerifier = React.useRef(null);
    const auth = getAuth(app)

    const sendCode = async () => {
        console.log(recaptchaVerifier.current)
        signInWithPhoneNumber(auth, phoneNumber, recaptchaVerifier.current!)
            .then(r => {
            console.log("Hej!")
        }).catch(err=>{
            console.log(err)
        })
    }

    return (
        <SafeAreaView
        style={tw.style('w-full')}>
            <FirebaseRecaptchaVerifierModal
                ref={recaptchaVerifier}
                firebaseConfig={app.options}
                attemptInvisibleVerification={true}
            />
            <TextInput
                style={tw.style('w-1/2', …
Run Code Online (Sandbox Code Playgroud)

react-native firebase-authentication expo

8
推荐指数
1
解决办法
1350
查看次数