Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FCM notifications not working in release app

I am trying to send FCM notifications (between users on sending messages, friend requests etc.) in release app which is not receiving but they are sending/receiving very well in debug apk, i have searched about this and found some solutions which are not working for me

like this, I placed it in pro-guard rules but not working

 -keep class com.google.firebase.* {*;}

In my AndroidManifest.xml

        <service
            android:name=".notifications.MyFirebaseMessaging"
            android:enabled="true"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>

        <service
            android:name=".notifications.MyFirebaseInstanceId"
            android:enabled="true"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>

and other dependencies, I am not including them here as the app is work fine in debug mode

Edited

I already have

  1. Generated Release SHA-1 and SHA-256 keys
  2. Add them in firebase console
  3. Also added Google console app-signing SHA-1 and SHA-256 keys in firebase
  4. Then download the Google-services.json file and add it in app module

enter image description here enter image description here

like image 521
mr. groot Avatar asked Oct 28 '25 10:10

mr. groot


1 Answers

You have not added your SHA-1 key for the release to your firebase console and hence not existing in your google-services.json.

  1. Generate your SHA-1 for release
  2. Add your release SHA-1 to firebase console
  3. Download and use new google-services.json.

If you're using Google play app-signing. Make sure the key being used by play store to sign your releases is also added in step 2

like image 63
Stuart Maleka Avatar answered Oct 29 '25 23:10

Stuart Maleka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!