androidfirebaseflutterpush-notificationfirebase-cloud-messaging

FCM notifications working in release mode but *not* from Play Store


So, I have FCM notifications setup on my flutter app. It works both for android an iOS in both debug and release modes.

When I create a release apk and test it on my phone, notifications work. But when I upload an appbundle to the play store, the version I download from the play store has notifications not working. The getToken method returns null, any ideas on why this could be the case?


Solution

  • I think you have not added SHA fingerprints for your release signing key. If you have selected something like this "Let google manage and protect your app signing key (recommended)", then you should go in Play Console, and then choose your app, go to App Signing under Setup (New version of Play Console). Your fingerprint will be available below "App Signing Key Certificate", copy it, then go to Firebase Console, inside your project, go in project settings, and then finally add your copied fingerprint. then download latest Google-services.json file and add it to your project. If you have not enabled Google signing, you have to find your fingerprint from the local signed key (which you used) using keytool and then add it.

    Read this: https://developers.google.com/android/guides/client-auth

    https://support.google.com/firebase/answer/9137403?hl=en