I am setting up Firebase Phone Auth in My App. I set up a Test Phone Number and a verification code in firebase auth section Whitelist. When I test with this Number and code, it's working. But When I Test With another number I got the Following error :
onVerificationFailed com.google.firebase.auth.FirebaseAuthInvalidCredentialsException:
The request contains malformed or mismatching credentials [ App ID does not match the requested project.
side note: I also use facebook account kit in this android app, and It goes well.
Any Suggestions?
In the Firebase console, open the Authentication section. In the Sign in method tab, enable the Phone provider if you haven't already. Open the Phone numbers for testing accordion menu. Provide the phone number you want to test, for example: +1 650-555-3434.
In phone authentication, the user has to verify his identity with his phone number. Inside the app user has to enter his phone number after that he will receive a verification code on his mobile number. He has to enter that verification code and verify his identity. So this is how phone authentication works.
On the Firebase Console, select the "Phone" authentication provider and click on the "Phone numbers for testing" dropdown. Enter a new phone number (e.g. +44 7444 555666 ) and a test code (e.g. 123456 ).
Please put SHA certificate fingerprint in your firebase
account.
To get this follow
these steps :
1.Open your project in Android Studio
2.Click on Gradle
Menu (From Right Side Panel )
3.Expand Your Project
-> Tasks
-> 'Android' -> Double click on siginingReports
4.You will see SHA-1
and MD5
fingerprint in your run tab
5.Copy it and paste in your firebase
console.
What worked for me :
1) Updated SHA1 certificate fingerprint for all package names (prod, dev..)
2) Downloaded google-services.json
and added to app/
3) Rebuild project
It's the third step that I missed. It wasn't suggested in any of these suggested answers, so I'm leaving the tip here. Hope that helps some of you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With