I followed this guide: https://rnfirebase.io/auth/phone-auth, to add phone auth to my app but it only works with test numbers but when i initiate the signInWithPhoneNumber function with my real number i get this error (even though i tried running the app on my own phone) and configured the sha-1 key and package name to firebase: This app is not authorized to use Firebase Authentication. Please verify that the correct package name and SHA-1 are configured in the Firebase Console. [ App validation failed. Is app running on a physical device? ]
const [confirm, setConfirm] = useState(null);
const [num, setNum] = useState('');
const [code, setCode] = useState('');
// Handle the button press
async function signInWithPhoneNumber(phoneNumber) {
const confirmation = await auth().signInWithPhoneNumber(phoneNumber);
setConfirm(confirmation);
}
async function confirmCode() {
try {
await confirm.confirm(code);
} catch (error) {
console.log('Invalid code.');
}
}
if (!confirm) {
return (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Input
placeholder='Enter phone number'
value={num}
onChangeText={(text) => setNum(text)}
leftIcon={
<Icon
name='user'
size={24}
color='black'
/>
}
/>
<Button
title="Phone Number Sign In"
onPress={() => signInWithPhoneNumber(num)}
/>
</View>
);
}
return (
<>
<TextInput value={code} onChangeText={text => setCode(text)} />
<Button title="Confirm Code" onPress={() => confirmCode()} />
</>
);