0

While sending FCMs, I've noticed these two headers are important(message won't go without these headers), but what could be the cons of sending both of these headers as it is? I tried to read about these content-negotiation headers but could not find any information about them in internet. The internet says that we need these headers only in iOS messages, but instead I required these for android messages notifications.

And are these headers location dependent? i.e only required if the location of transmitter and receiver is long?


GCM/FCM=Google Cloud Messaging/Firebase Cloud Messaging. A product used to send notification to android devices.

Articles found on internet:

https://stackoverflow.com/questions/77102069/why-is-gcm-and-apn-notifications-going-on-some-clients-and-not-on-others

https://stackoverflow.com/questions/44846973/not-receiving-push-notifications-if-sending-data-but-notification-works-pa?rq=2

3
  • If you're talking about GCM / FCM then please add a tag to your Question. If your WTF TLA is about something else, then please spell it out if you wish to convey the meaning of your sentence to humans who might read it. Rather than mumble about "internet says", please mention some particular URL that folks can go visit for context about this problem space.
    – J_H
    Oct 12, 2023 at 2:56
  • Updated everything in post. Tell me if you wan some more!
    – tuck_y
    Oct 12, 2023 at 3:17
  • 1
    Thank you for the clarity, much appreciated!
    – J_H
    Oct 12, 2023 at 3:37

1 Answer 1

0

tried to read about these content-negotiation headers but could not find any information about them in internet.

I don't understand this remark. Upon consulting the vendor's documentation a search for the header field, "content-available", immediately reveals:

On iOS, use this field to represent content-available in the APNs payload. When a notification or data message is sent and this is set to true, an inactive client app is awoken. On Android, data messages wake the app by default.

The value defaults to False, so if you don't know what type of client you're sending to and if you support any iOS users that use the Apple Push Notification service, you will likely want to set this flag.

Similarly the "content-priority" documentation explains:

You have two options for assigning delivery priority to downstream messages:

  • Normal priority. Normal priority messages are delivered immediately when the app is in the foreground. For backgrounded apps, delivery may be delayed. For less time-sensitive messages, such as notifications of new email, keeping your UI in sync, or syncing app data in the background, choose normal delivery priority.
  • High priority. FCM attempts to deliver high priority messages immediately even if the device is in Doze mode.

The vendor documentation seems fairly clear. When serving heterogeneous client types, the headers have orthogonal meanings. The headers are not location dependent. Supply one or both headers if they fit your application's use case.

If you found the documentation ambiguous or wrong, definitely file a documentation bug with the vendor.

3
  • Why do I require content-available=true for android as well? Did something changed since android 13?
    – tuck_y
    Oct 12, 2023 at 4:27
  • Sounds like the behavior changed in a way that the docs don't reflect. Definitely worth filing a documentation bug with the vendor.
    – J_H
    Oct 12, 2023 at 6:04
  • Ok I'll email them.
    – tuck_y
    Oct 12, 2023 at 7:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.