How to disable google firebase authentication ReCaptcha in the react native? I referred to so many resources I haven't found any solution.
import React, { useState, useRef } from "react";
import { Text, TextInput, TouchableOpacity, View } from "react-native";
import { FirebaseRecaptchaVerifierModal } from "expo-firebase-recaptcha";
import firebase from "../Firebase/Firebase";
export default Phone = () => {
const [verificationId, setVerificationId] = React.useState();
const [verificationCode, setVerificationCode] = React.useState();
const [phoneNumber, setPhoneNumber] = useState("");
const firebaseConfig = firebase.apps.length
? firebase.app().options
: undefined;
const recaptchaVerifier = useRef(null);
const [code, setCode] = useState("");
const sendVerification = () => {
const phoneProvider = new firebase.auth.PhoneAuthProvider();
phoneProvider
.verifyPhoneNumber(phoneNumber, recaptchaVerifier.current)
.then(setVerificationId)
.catch((error) => {
alert(error);
return;
});
console.log(setVerificationId);
};
const confirmCode = () => {
const credential = firebase.auth.PhoneAuthProvider.credential(
verificationId,
code
);
firebase
.auth()
.signInWithCredential(credential)
.then((result) => {
console.log(result.user);
});
};
return (
<View>
<View>
<TextInput
placeholder="Phone Number"
onChangeText={setPhoneNumber}
keyboardType="phone-pad"
autoCompleteType="tel"
/>
<TouchableOpacity onPress={sendVerification}>
<Text>Send Verification</Text>
</TouchableOpacity>
<TextInput
placeholder="Confirmation Code"
onChangeText={setCode}
keyboardType="number-pad"
/>
<TouchableOpacity onPress={confirmCode}>
<Text>Send Verification</Text>
</TouchableOpacity>
<FirebaseRecaptchaVerifierModal
ref={recaptchaVerifier}
firebaseConfig={firebaseConfig}
/>
</View>
</View>
);
};