I follow the docs download google-service.json and also add SH1 key in firebase console and then copy the example code and try to run it but i saw the below issue.Help Needed. Thanks.
This request is missing a valid app identifier, meaning that neither SafetyNet checks nor reCAPTCHA checks succeeded. Please try again, or check the logcat for more details.
import React, { useState } from 'react';
import { Button, TextInput, View } from 'react-native';
import auth from '@react-native-firebase/auth';
const PhoneSignIn = ()=>{
// If null, no SMS has been sent
const [confirm, setConfirm] = useState(null);
const [number, setNumber] = useState(false)
const [code, setCode] = useState('');
// Handle the button press
const _signInWithPhoneNumber = async()=>{
if(!number) return
alert(number)
const confirmation = await auth().signInWithPhoneNumber(number)
console.log(confirmation)
setConfirm(confirmation);
}
const confirmCode= async()=>{
try {
await confirm.confirm(code).then(res => {
alert(`Verified! ${res.user.uid}`)
})
} catch (error) {
console.log('Invalid code.');
}
}
if (!confirm) {
return (
<View style= {{flex: 1}}>
<TextInput style={{ width: '100%'}} placeholder= "enter number +923075018584" onChangeText={text => setNumber(text)}/>
<Button
title="Phone Number Sign In"
onPress={() => _signInWithPhoneNumber()}
/>
</View>
);
}
return (
<>
<TextInput value={code} placeholder="Code" onChangeText={text => setCode(text)} />
<Button title="Confirm Code" onPress={() => confirmCode()} />
</>
);
}
export default PhoneSignIn
package.json:"@react-native-firebase/app": "^8.4.7",
"@react-native-firebase/auth": "^9.3.2",
"react-native": "^0.63.2",
android/gradle.settings jetifier=true for Android compatibility?jetifier for react-native compatibility?@andymatuschak need help
I am also getting the same error. Help me in fixing this @Osamasomy if you found a solution.
@dileepkantapop still no luck brother.
@mlc @andymatuschak @felixclack any help on this problem?
@adamrosey It's related to SHA1 and SHA256 keys, in console.cloud.google.com for your project enable "Android Device Verification",
keep sha1 and sha256 keys 256 keys updated in firebase console for your app. That solved my error.
Read this: https://firebase.google.com/docs/auth/android/phone-auth#enable-app-verification
still face the same problem i added sh1 and sh256 key in firebase console.
@Osamasomy Did you download the new and replace the old google-services.json after adding sha1 in firebase console?
@Osamasomy Also you need to add test phone numbers in the firebase console, then you can test your phone auth.
@Osamasomy bro do u already have the solution? please im facing the same issue in my android app
You have to authenticate your app via SHA-1 and SHA-256.
if not resolve -> Check -> you have to declare Firebase auth in you class and use that auth instance to login with credentials you get from firebase.
if not resolve -> Check -> Proper dependencies you are adding - Versions??
if not resolve -> You also have to add Captche reading facility for mobile to access browser. For this add dependency -> com.android.support:customtabs
I have some issues
@bunbalhara that is no way to get help, sorry :-). What would you do if a co-worker came up to you and said that? It's not actionable at all. You'd say either "then you should seek help", or "what's the problem". But there is no expectation you could solve the problem.
Same issue,
@mfaisalabbasi that is also not actionable.
If no one posts details, and verifies their SHA1 and SHA256 is up to date per the comment above, while running on current versions (v10.1.0 of react-native-firebase) I will close and lock this issue as it is not useful and is attracting low quality comments.
@mikehardy SHA1 and SHA256 are up date,
And this is my pakage.json pkg details.
"@react-native-firebase/app": "^10.1.0",
"@react-native-firebase/auth": "^10.1.0",
And It's working when I used to Enter number that is already in firebase testing purpose, but when I use Random number it causing error.
simply testing number working.
@mfaisalabbasi please attest you have enabled verification https://firebase.google.com/docs/auth/android/phone-auth#enable-app-verification
please verify you are testing a real device plugged in to your computer
Please follow adb logcat for the device and see if anything interesting pops out for your app
Yup i enabled android device verification and i am using real devices
connected through usb
And let me check adb logcat
On Wed, 2 Dec 2020, 6:38 pm Mike Hardy, notifications@github.com wrote:
@mfaisalabbasi https://github.com/mfaisalabbasi please attest you have
enabled verification
https://firebase.google.com/docs/auth/android/phone-auth#enable-app-verification
please verify you are testing a real device plugged in to your computer
Please follow adb logcat for the device and see if anything interesting
pops out for your app—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/invertase/react-native-firebase/issues/4505#issuecomment-737235159,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ALM3JINTSGXGZSZTK2Y3RRTSSY7M5ANCNFSM4TLGQLFA
.
Getting same issue followed all the steps
@mikehardy my adb logcat details
Failed to get auth token due to class gap
WGetToken: [GetToken]GetToken failed with status code: BadAuthentication
Error when getting token
W GoogleAuthUtil: com.google.android.gms.auth.UserRecoverableAuthException: BadAuthentication

@Avhishek05 so catching up to the state of the issue: how did it go when you looked at adb logcat? We're looking for new information at the moment, "me toos" do not advance the discussion. Not to be harsh but we all have limited time, yes? Advance things or just watch + listen
@mikehardy I have posted adb logcat in my last comment.
@Avhishek05 you posted some sort of truncated image thing? Posting logcat is like:
here are a bunch of logcat lines
Or attaching logcat.txt ...
I had the same issue; The SHA-1 and SHA-256 fingerprints I provided at Firebase Console were not _correct_ somehow.
Executed this command in Project's root directory keytool -list -v -keystore ./android/app/debug.keystore -alias androiddebugkey -storepass android -keypass android to get SHA-1 and SHA-256 fingerprints.
Updating Firebase console with newly acquired values resolved the issue for me.
I think this will resolve to a project setup issue every time. I'm going to close it as unactionable - the react-native-firebase is known to work
Im still having the same issue despite of all the information you guys have provided this is frustrating please need help
@mikehardy can you help me
No I can't. You have a project-specific setup issue. Frustrating I am sure, but the information above about carefully getting the SHA hashes of the actual keystores used to sign the app for delivery etc etc and configuring everything is it.
Most helpful comment
I had the same issue; The SHA-1 and SHA-256 fingerprints I provided at Firebase Console were not _correct_ somehow.
Executed this command in Project's root directory
keytool -list -v -keystore ./android/app/debug.keystore -alias androiddebugkey -storepass android -keypass androidto get SHA-1 and SHA-256 fingerprints.Updating Firebase console with newly acquired values resolved the issue for me.