0

I'm using GCM example app for iOS from google. So far the app works when the app is on the foreground and background i.e. it receive a message I sent using postman. But when I force the app to quit, it doesn't receive my message anymore. I do set "priority" parameters to high as suggested by virtually everyone, but the app is still doesn't receive any message after force quit.

Here's my JSON to GCM server:

{
  "notification": {
    "message" : "great match!"
  },
  "data": {
    "msg" : "great match!",
    "title" : "Portugal vs. Denmark"
  },
  "to" : "<MY-TOKEN>",
  "content_available" : true,
  "priority": "high"
}

And the response from GCM is:

{
  "multicast_id": 6087504353579807411,
  "success": 1,
  "failure": 0,
  "canonical_ids": 0,
  "results": [
    {
      "message_id": "0:1460007343814475%c3a976d6c3a976d6"
    }
  ]
}

I saw this question that says, it is not possible to receive push notification when the app is force-quit. But in the other hand, this issue seems to say otherwise.

So, my question is:

  1. Is it possible for iOS app to receive GCM push notification after the app is forced to quit?
  2. If it is possible, then what else can I try since setting "priority" to high doesn't work.
Community
  • 1
  • 1
Chlind
  • 215
  • 2
  • 10

1 Answers1

0

Basically according to issue #67 and issue #60 to answer your first question the only work around made is to set the the message priority to high. Some cases it works and some is still experiencing not receiving the notification.

For iOS client apps, normal and high priority are analogous to APNs priority levels 5 and 10. For full detail on iOS-specific behavior, see the APNs documentation.

The priority of the notification. Specify one of the following values:

  • 10–Send the push message immediately. Notifications with this priority must trigger an alert, sound, or badge on the target device. It is an error to use this priority for a push notification that contains only the content-available key.

  • 5—Send the push message at a time that takes into account power considerations for the device. Notifications with this priority might be grouped and delivered in bursts. They are throttled, and in some cases are not delivered. If you omit this header, the APNs server sets the priority to 10.

You can try setting the APN priority levels and check the issue tracker in the github.

I hope it helps you.

Community
  • 1
  • 1
Mr.Rebot
  • 6,703
  • 2
  • 16
  • 91