Firebase Phone OTP is not sent when attemptInvisibleVerification is true

Hi, I am working on a react native project. I have a screen which captures the user’s mobile number and redirects the user to the OTP screen. In the OTP screen, I want the OTP to be sent to the entered phone number. However, when attemptInvisibleVerification is set to true, then the OTP is not sent in the SendOTP function which is called in UseEffect. When I debug, the debug pointer gets struck at verifyPhoneNumber method.

<FirebaseRecaptcha.FirebaseRecaptchaVerifierModal
ref={recaptchaVerifier}
firebaseConfig={firebaseConfig}
attemptInvisibleVerification={true}
/>

async function sendOTP() {
const phoneProvider = new PhoneAuthProvider(auth);
try {
const recap = recaptchaVerifier.current;
const verificationId = await phoneProvider.verifyPhoneNumber(
'+91 ’ + enteredMobileNumber,
recap
);
setVerificationId(verificationId);

} catch (error) {
  console.error(error);
}

}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.