Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

ios - Background GCM Push Notification Not Received on Certain Apple Devices

I have my iOS app set up to receive push notifications via GCM. Having set everything up, I am able to receive notifications when the app is in the foreground on various Apple devices. However, when the app is in the background, I only receive push notifications for certain devices, namely only my iPhone 6. Other devices, such as an iPhone 5s and an iPod Touch are only able to capture notifications when the app is in the foreground.

I looked into other people's questions regarding this issue, bug I have yet to see one that is device model specific. Often it comes down to not setting the content_available: true setting, but I have it set. Here is an example of a payload I am using:

{
    "to":".....",
    "content_available":true,
    "notification": {
            "title":"my title",
            "body":"my body",
            "sound":"default"
    }
}

I receive this background notification exactly how I'd want to on my iPhone 6 (my phone is woken and I see a banner), but other devices (which are also using iOS v8.4.1) do not respond to the notification when the app is in the background.

Other details:

  • I am using Enterprise build
  • I am using the production APN server (and specify so in the GCM registration options)
  • Although I don't think it's necessary, I have all the devices registered with my Apple developer account.

Any thoughts would be appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...