4

Hello all i am integrating GCM in iOS application using following link

https://developers.google.com/cloud-messaging/ios/start.

I have also uploaded the certificates when configuring the file on defined steps.

I have also succeeded for getting notification,but the problem is that i am not getting the notification when the application is killed or in background.Is there any implementation for getting notification in background or killed ios application as i have searched a lot for that and nothing found fruitful.

So any help will be appreciated Thanks..

jogshardik
  • 1,446
  • 1
  • 12
  • 23

1 Answers1

5

I had same problem and I posted detailed question later. Luckily, I figured out the problem and it is working for me now. I was not sending data in proper format that got working after I sent data in proper format. My JSON format looks like this.

{
"notification":{
"badge":"12",
"alert":"default",
"sound":"default",
"title":"default"
},
"content_available":true,
"to":"YOUR_KEY_HERE"
}

Since there isn't details available on your sever implementation. you can refer my question for more information.

GCM push notification to iOS with content_available (not working to invoke from inactive state)

Community
  • 1
  • 1
chinmay gajjar
  • 146
  • 1
  • 8
  • i have already implemented it before your answer they put it in note, which i have not seen but after getting this problem i show their detail document. – jogshardik Jun 18 '15 at 05:23
  • I found that to get the alert to actually appear on iOS (instead of a silent alert), you need to add "body":"hello world" to the "notification" dictionary. – Jeremy Jun 20 '15 at 08:42
  • That would be so useful. Thank you Jeremy. – chinmay gajjar Jun 22 '15 at 15:15