fcm icon indicating copy to clipboard operation
fcm copied to clipboard

iOS and Android differences

Open ghost opened this issue 8 years ago • 4 comments

It might be worthwhile to document the different fields of Message which are for iOS, Android, or both.

ghost avatar Jan 18 '17 20:01 ghost

Hi @bontibon If you need docs, here is description https://firebase.google.com/docs/cloud-messaging/http-server-ref#notification-payload-support

Later, I am gonna update GoDoc, or, if you want, you can do it :)

edganiukov avatar Jan 20 '17 14:01 edganiukov

@bontibon You can try gorush which support APNS for sending the notification to the iOS device.

appleboy avatar Jun 02 '17 14:06 appleboy

It looks like fcm.Message does not even support the platform specific fields looking at https://firebase.google.com/docs/cloud-messaging/concept-options#setting-the-priority-of-a-message these fields should be sent as

{
  "message":{
    "topic":"subscriber-updates",
    "notification":{
      "body" : "This week's edition is now available.",
      "title" : "NewsMagazine.com",
    },
    "data" : {
      "volume" : "3.21.15",
      "contents" : "http://www.news-magazine.com/world-week/21659772"
    },
    "android":{
      "priority":"normal"
    },
    "apns":{
      "headers":{
        "apns-priority":"5"
      }
    },
    "webpush": {
      "headers": {
        "Urgency": "high"
      }
    }
  }
}

But fcm.Message lacks the fields for "android", "apns", and "webpush" or does this project strictly use the legacy API documented here https://firebase.google.com/docs/cloud-messaging/http-server-ref

vendion avatar Aug 27 '20 14:08 vendion

@vendion this lib supports only legacy fcm API, no new (v1) API.

edganiukov avatar Aug 27 '20 20:08 edganiukov