Reputation: 132
Sometimes FCM sending messaging and sometime delay occurs or never received on the devices. if FCM is not reliable then please suggest the alternatives for push notifications.
Upvotes: 3
Views: 686
Reputation: 132
FCM creating notification issue on the following devices,
iPhone 6 Plus running app store version receives the notification
iPhone X running testflight version does NOT receives
Solution:
For some reason, the iPhone X needs that the payload contains "notification: {"title":"xxx", "body":"xxx"}" which makes no sense since the iPhone 6 and iPhone 6 plus can receive a push notification without that added payload... The problem now is that adding "notification" to the payload will make iOS show the notification on tray immediately upon receiving it, witch beats the purpose of the "silent" notification I want to deliver.
Here's the previous payload that don't work on iPhone X but works on iPhone 6 and iPhone 6 plus(FCM takes care of adding the content-available tag):
{"message": {"token" : "eANw_OLOKXc:APA.....XsMg", "data" : {"content" : "2546|N|495....arg|BATTERY|||||"}}}
And here's the one that works with iPhone X and set the priority to high at backend.
{"message": {"token" : "eANw_OLOKXc:APA.....XsMg", "notification":{"title":"xxx","body":"xxx"},"data" : {"content" : "2546|N|495....arg|BATTERY|||||"}}}
Upvotes: 4