1

I'm having a weird issue with FCM, specifically when sending silent push notifications to iOS devices.

Here is the JSON we were sending on the HTTP request to Firebase four days ago:

{
    "to": "<firebase token>",
    "content_available": true
}

Today, that JSON no longer works. Based on this StackOverflow response, I tried adding the sound property like so:

{
    "to": "<firebase token>",
    "content_available": true,
    "notification": {
        "sound": ""
    }
}

Now this works. I shouldn't need to specify an empty sound property on this in order to get it working.

For context, these are things that do work:

  • Sending non-silent push notifications through Firebase Cloud Messaging
  • Sending silent and non-silent push notifications directly through APNs

Anyone have an idea on what's going on?

hisaac
  • 111
  • 1
  • 11
  • I'm wondering if setting "content_available": true" should be "content_available": false" in your first example since you are sending no content. – Barns Oct 31 '17 at 23:20
  • This is all new to me, so I could be wrong, but my understanding is that `content_available` is specifying that there is content available for the phone to download from somewhere else, basically telling the phone it's outdated and needs to go download something. I don't think it's supposed to need anything else. – hisaac Nov 01 '17 at 10:29
  • If I send the request directly through APNs, the only thing that's needed is: `{ "aps": { "content-available": 1 } }`. That works correctly with no other properties needed. – hisaac Nov 01 '17 at 10:30
  • Based on further research, this appears to be an issue with iOS 11 specifically. Unfortunately, we'll just have to keep sending the "notification" property for now until Apple fixes the bug. – hisaac Nov 16 '17 at 13:37

0 Answers0