Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS and Android differences #4

Open
ghost opened this issue Jan 18, 2017 · 4 comments
Open

iOS and Android differences #4

ghost opened this issue Jan 18, 2017 · 4 comments

Comments

@ghost
Copy link

ghost commented Jan 18, 2017

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

@edganiukov
Copy link
Owner

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 :)

@appleboy
Copy link

appleboy commented Jun 2, 2017

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

@vendion
Copy link

vendion commented Aug 27, 2020

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

@edganiukov
Copy link
Owner

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

Repository owner deleted a comment from DylanZhu2021 Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants