+1
We hit this as well, I had to do a few things. First I had to go to the Google Play Console, select the app and then go to Services and APIs under development tools. You will see Firebase Cloud Messaging (FCM) with an option to Link Sender ID. Click this and put in the sender ID from your Firebase settings. Then you have to make sure to use the format
{
"GCM": "{ \"notification\": { \"text\": \"test message\" } }"
}
Credit for the format goes to this guy. This fixed it for our app.
Also as noted in the post above you have to have something that extends FirebaseMessagingService if you want to be able to use the new format. I don't know Android so if someone implements that I bet people would appreciate it.
I have used FCM instead of GCM with this library for android app. It was success for app in foreground and background state, but not in app kill state. Any idea about the app kill state with FCM ?
I managed to do it with FCM. I followed the instructions as they are and instead of GCM keys I put in FCM keys and that was it.
@urska19 in app/build.gradle, did you import what the default instructions say,
compile ('com.google.android.gms:play-services-gcm:8.1.0') {
force = true;
}
Or did you change it to use a firebase cloud messaging package?
@waterdoo yes, I imported what the instruction said and just changed the version, so that it matched to the version of play-services-maps that I already had. This is what I have
compile 'com.google.android.gms:play-services-gcm:10.0.1'
I followed both instructions in this repo and in the FCM docs and still nothing, I think I'm missing something but don't what or how to test what's wrong
Did you also followed the instructions from FCM, adding com.google.gms.google-services ??
I tried https://pushtry.com/ and both notifications work but the one from FCM doesn't trigger the onNotification, not when received nor when opened, the one from GCM works fine
@urska19 what key did you put where?
@L3V147H4N In function PushNotification.configure instead of "YOUR GCM SENDER ID" I put sender Id from FCM project. Everything else is as written in Android manual Installation, except version of com.google.android.gms:play-services-gcm:11.0.2, which is the same as other play-services services that I use.
I hope this helps.
@urska19 thanks for the reply, I already turn to react-native-fcm and it's seems to be working fine
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.