Reputation: 318
I have the following issue while retrieving firebase Token with
FirebaseMessaging.getInstance().getToken()
in DEBUG mode I get the token and I send it to the server
in RUN mode, the app works fine, it's published BUT I can't get the token since I've got thanks to Crashlytics @Firebase console
java.io.IOException: FIS_AUTH_ERROR
I tried all suggested solutions found here java.io.IOException: FIS_AUTH_ERROR in Android Firebase without success
Library used, build.gradle (:app)
implementation platform('com.google.firebase:firebase-bom:26.7.0')
Upvotes: 6
Views: 11595
Reputation: 1062
I realized that I didn't add my dev certificates to the APIs that that flavour was using. Let me just copy+paste the answer I gave in another thread:
If you have your APIs keys restricted (which you should), make sure you add your dev certificate and bundle ID to the key/s.
Visit your dashboard, select the project from top bar -> API keys and there you should see them (auto created by Firebase).
Hope this solves your problem!
EDIT: More details about this issue (see comments).
You should only need 1 SHA/instance and for release only for the signing certificate. I will advice you to use flavours for each different part of dev/testing/release. Each dev should provide the local debug certificate and these can be used to sign in app distributed via Firebase, for example. Separate, a set of production APIs which will be best to restrict on the release certificate ONLY.
Just remember that every new PC used for developing will require to provide the SHA to be added in the restrictions. It will be a ride to forget about this part! :)
Good luck!
Upvotes: 3