0

I'm using GCM to implement push notifications in iOS, when the application is active it will receive the notification, but if its inactive it will not show an alert, and wait for the application to become active to handle it.

The received notification is this:

 [post_title : new post, post_id :1067 lang : english, post_type:  News , from : 865414108428]
Chewpers
  • 2,430
  • 5
  • 23
  • 30
iOS Developer
  • 187
  • 1
  • 2
  • 9
  • can you clarify what you want to accomplish? Kindly provide a detailed question so the community can provide you useful insights. Thanks in advance :) – Mr.Rebot May 04 '16 at 07:32

2 Answers2

0

From the docs:

If you want to send messages consisting of only custom key/values to an iOS device when the app is in the background, set custom key/value pairs in data and set content_available to true.

I hope this helps you.

joarleymoraes
  • 1,891
  • 14
  • 16
0

First Step - use this method in appDelegate.m

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler

Second see in Imageenter image description here

Add also check this

Making GCM work for iOS device in the background

Community
  • 1
  • 1
Nishant Gupta
  • 457
  • 3
  • 16