The phone authentication works when using the debug version of my app and also works when I manually install the release-signed apk on a phone. But when I publish the same working apk to Play Store (Alpha Testing) I can't make it to work. After digging a bit a got this:
This app is not authorized to use Firebase Authentication. Please verifythat the correct package name and SHA-1 are configured in the Firebase Console. [ App validation failed ]
I know what it looks like. But I can assure I've added the correct SHA-1 into Firebase console and check it before publication.
My questions: Is there something else I should look at? I've also double checked the google-services.json with no success.
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.
Don't forget to go in Firebase Project Settings > App check > and Register firebase project in SafetyNet and Play Integrity register with default time token 1 hour and u will remove reCaptcha from phone auth OTP! That's awesome.
On the Blaze plan, Phone Authentication provides a no-cost tier. The first 10K verifications for both instances (USA, Canada, and India and All other countries) are provided at no cost each month. You are only charged on usage past this no-cost allotment. Prices are per successful verification.
You might have been using google play signing so just need to copy SHA1 from your play store console (under Release Management -> App Signing) to firebase console ( project settings -> Add fingerPrint ).
I was facing the same issue and it works for me.
You have to add the release build application SHA-1 to the firebase. Go to firebase console. Open Project Settings
Then open the Application
To get your SHA-1 checksum for release app,
change firebase project setting
Press add fingerprint button
Select Gradle in android studio from right panel
Select Your App
In tasks -> android-> signingReportDouble click signingReport
.
You will find the sha1 fingerprint in the Gradle Console
add this sha1 fingerprint in firebase console
After spending the whole Day figuring out what was the issue. I’ve found the culprit! It was in the App Signing for Google Play that we have opted-in.We need to register the SHA-1 from the App Signing itself. It can be found in the inside Google Play Console under Release Management > App Signing. It will have two types of certificate:
1.Upload certificate: this is the information of the certificate from the keystore that uploaded. This is needed to be the same with the keystore for app signing locally as the Google Play will verify the uploaded app to match with this signed certificate.
2.App Signing certificate: after uploaded the app, Google will replace the upload certificate with this certificate. This is a new certificate that will be used for published app in Play Store.
With those information, I just realize that we hadn’t registered the SHA-1 for the App Signing certificate which being used by published app. So, I added the SHA-1 (also the SHA-256, just in case needed) fingerprints in the Firebase > Project Setting for the app (Don’t forget to update the latest config file after added the fingerprints).
So After adding your your SHA Fingerprints, your Firebase SHA certificate fingerprints will look like this:
Now click save and Try to run your App it will work fine.
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