GCM works fine on Android but not working on iOS

后端 未结 2 1528
眼角桃花
眼角桃花 2020-12-21 06:13

I\'ve succefuly implemented the GCM for android but when I tried to implement it to my iOS version I won\'t get the push messages.

I got my gcm token at the iOS vers

相关标签:
2条回答
  • 2020-12-21 06:31

    Unbelievable, had to change "data" with "notification". The payload for iOS is bit different. More info can be found here

    0 讨论(0)
  • 2020-12-21 06:51

    I had the same problem, and it's fixed by using content_available and priority options as shown in below documentation:

    You should send "content_available":true, and "priority":"high",

    https://developers.google.com/cloud-messaging/http-server-ref

    Sample JSON request:

    {
      "content_available":true,
      "to":"fd4...23f7",
      "priority":"high",
      "notification":
        {
        "body":"anything",
        "title":"any title"
        }
    }
    
    0 讨论(0)
提交回复
热议问题