Haider Ali
Haider Ali

Reputation: 132

Firebase notification not working properly using FCM service

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

Answers (1)

Haider Ali
Haider Ali

Reputation: 132

FCM creating notification issue on the following devices,

  • iPhone 6 connected to Xcode receives the notification
  • iPhone 6 running testflight version receives the notification
  • iPhone 6 running app store version receives the notification
  • iPhone 6 Plus connected to Xcode receives the notification
  • iPhone 6 Plus running testflight version receives the notification
  • 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

Related Questions