Agung
Agung

Reputation: 13863

Firebase Cloud Messaging is not working after publishing Android app in play store

So, my app will receive FCM push notification when I run the app in debug or release mode for Android or in my iOS app, no issue at all. but after publishing my app on the Google Play App Store, then suddenly my Android app will not receive FCM push notification.

I suspect this is related to Google Play App Signing, because I also have an issue with Google Sign In. I can solve the Google Sign In issue after copying the SHA-1 certificate fingerprint from the Google Play Console (App Integrity) to my Firebase Console

I have also added the SHA-1 release and debug to the firebase console.

but unfortunately I still have problem with Firebase Cloud Messaging, the message is just not appear on my notification tray.

am I missing something? please help :)

Upvotes: 3

Views: 5321

Answers (1)

Agung
Agung

Reputation: 13863

I finally can solve this problem.

in my case, this problem will occur if you publish your app using Google Play App Signing and you use API key restriction for your Android App in your Google Cloud Platform (GCP).

I would fail to get the FCM ID from the device, that's why our own backend could not send push notification to the Android device because FCM ID was not sent to our backend

here is the solution for this case

  1. Open your Google Play Console, you have to copy the SHA-1 certificate fingerprint. On the left bar, please find Setup --> App Integrity

enter image description here

  1. open credentials section on the GCP console, and select your Android key. you can access it on here: https://console.cloud.google.com/apis/credentials

enter image description here

  1. then add new item, paste the SHA-1 you get in here, and don't forget to save ! enter image description here

in my case the error that cause this problem was:

java.io.IOException: FIS_AUTH_ERROR

so if my solution doesn't work, you may need to follow this answer

I hope this helps

Upvotes: 6

Related Questions