I have made a flutter app with firebase with OTP verification, it is working fine in debug mode and releasing APK
. But after uploading to playstore the phone doesn't receive an OTP message. I have added the SHA - 1
and SHA - 256
keys from the play console to firebase project settings, still not working. Is there a time delay or something before the change is reflected in the application after updating the app in playstore (Internal testing)?
For debug keys : Open your project in android studio > Click on Gradle (In the right panel) > Click on Your Project > Click on Tasks > Click on android > Double Click on signingReport
For release keys : Use this command to generate release keys: keytool -list -v -keystore "your jks file path " -alias "key name"
Add jks path and key name and run this command in android studio terminal.
OR
You can also get SHA1 and SHA- 256 from google play console . Go to Play store Console > Your project > Release > Setup > App signing .
- Copy both debug and release SHA1 and SHA- 256 keys and paste in firebase console .
- Update your firebase-auth version to 20.0.1 then you also need to configure safetynet in your project. For more info check this link
- Make sure PHONE AUTHENTICATION is enabled . Go to Firebase console -> Authentication -> Sign-in Methods.
- After adding keys , download updated google-services.json and add in your project.
- Clean project and then rebuild project.
- Test your app again (In order to prevent abuse the firebase phone authentication wont work in emulator so test on real device).
Check if you have completed all the above steps in your proejct . If your app is live on play store make sure your firebase project have both debug & release SHA1,SHA-256 key in your firebase console.
I also came across same problem with phone authentication You can go to Google cloud platform of the firebase app From there go to credentials (You can search credentials) Add a OAuth credential give the sha1 that you get from play console and package name while creating this OAuth credential This worked for me
Several possibilities come to mind. After entering your Sha key, you need to add the new json file to your project. Firebase responds quickly to updates
Another possibility is cloud rules. Check this area. This situation may halt the process.
It might be because you have uploaded only release signing keys. Add upload keys from Google Play Console and it will work.
You need to install the Google Play service in Firebase. Follow the following steps:
- Go to Firebase console -> Click your project
- Click on settings icon which is right of Project Overview -> then Project settings -> Under Integrations -> Click on Link option under Google Play
Update SHA-1 Key in Firebase project setting
Also check your google cloud project api key setting and also add SHA-1 Key credentials if you have Key restrictions.
I am expanding on the solution provided in this answer as it was not sufficient to solve it for my case.
If you are working on a release version of the app then go to Google play console > setup > app integrity > app signing. You will find a list of SHA-1 and SHA-256 fingerprints. Enter the first ones under "App signing key certificate" into Firebase project config.
© 2022 - 2024 — McMap. All rights reserved.