1

i am not able to receive notifications in iOS when the application is not in foreground, GCM says that the message has been delivered but APNS does not send the notification to iOS. When application is in foreground all works perfectly.

I have already configured in Google API console the GCM API so i have the credentials (server-key to delivery and project id (senderid) for the app).

I am following the documentation for GCM 3.0 using the example app.

I send a regular GCM message with the data field in the payload.

The JSON i send is:

{
"collapse_key":"my_collapse_key",
"delay_while_idle":false,
"data":{
   "message":"hi+iOS",
   "nRef":"a8e158b4b67b69171a3365417ed3ccba15d8a333",
   "ts":"1434439237277",
   "nId":"814d84630456b4dd1e2df528f1353374ed2b1567"
},
"registration_ids":[
"my_token_reg_id"
]
}

I am using a created configuration profile (plist), as google asks, for the iOS app that has only the development certificate.

Thanks.

  • 1
    what is problem in android ? why there is android tag ? – N J Jun 15 '15 at 16:46
  • Are you shure you allow notification permissions? – Masterfego Jun 15 '15 at 17:02
  • Can you provide with request parameters that you use? Do you send a display notification (with "notification" in the request) or a regular GCM message? – TheWonderBird Jun 16 '15 at 01:53
  • I send a regular GCM message with the data field in the payload. I tried also with the notification field in the payload but still the same, iOS app does not receives the notification through APNS when device is idle or the application is in background. – Javier Gonzalez Serrano Jun 16 '15 at 07:14
  • There is a specific format of Push message. If you will not send in that format the notification will not received when the app is in background. – Adeel Ur Rehman Jun 16 '15 at 07:32
  • 1
    I have discovered the reason! I had to use "notification" parameter in the payload BUT USING "body" AND "title" FIELDS to set the tittle and the body of the notification. Notification extra data can be set in the "data" parameter. Thanks anyway! – Javier Gonzalez Serrano Jun 16 '15 at 08:06
  • 2
    possible duplicate of [GCM support for ios application when application in background or killed](http://stackoverflow.com/questions/30883607/gcm-support-for-ios-application-when-application-in-background-or-killed) – Uyghur Lives Matter Jul 27 '15 at 13:05
  • @JavierGonzalezSerrano Can you add an answer that elaborates on how you solved the issue? – Joe Shaw Dec 01 '15 at 16:55

0 Answers0