mori mori - 1 year ago 144
iOS Question

Cannot receive notification in iOS [Firebase]

I'm using Firebase Cloud Messaging and create a cron for my notification instead of using the Firebase console. I'm wondering if I can use the same json i used for android. Currently my android device receives the notification I send but in my iOS it doesn't. I'm wondering if its because some of the parameter I used like in

object for example
is only for android platform, does it effect the result?

My post request looks like this

"registration_ids" : $ids,
"notification" : {
"body" : "great match!",
"title" : "Portugal vs. Denmark"
"icon" : "myicon"
"data" : {
"Nick" : "Mario",
"Room" : "PortugalVSDenmark"


As suggested, I created two different cron for my iOS and Android, in my iOS i just removed the
parameter in the json. But still i cannot received any notification.

Also under
Capabilities Tab -> Push Notifications
, i toggle it
, also in
Background Modes-> Remote notifications

Answer Source

You can use the same json for both android and ios. Firebase Cloud Messaging will use the relevant parameters for each platform


  • icon will be removed from messages targeting iOS since that platform doesn't support changing the icon.

  • sound should be a filename with extension (extension required for ios). Firebase will remove the extension when targeting an android device.

Regarding the messages not being delivered to iOS try to increase the priority parameter.

When the ios app is in background Firebase uses APNs to deliver the message, and APNs often delay messages that don't have high priority.

If that doesn't work please check your APNs certificate configuration.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download