I am doing push notification in my project through GCM. My Application is able to receive notification in foreground but not in background.
I receive a message inside the method
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject])
when the application is in foreground but I am not getting any call to the method
func application( application: UIApplication,
didReceiveRemoteNotification userInfo: [NSObject : AnyObject],
fetchCompletionHandler handler: (UIBackgroundFetchResult) -> Void)
when the application in background mode.
I had a long search in Internet and came to know that it's the problem with the payload format I receive. The payload I received looks like
[notification: {"body":"anything","title":"any title"}, priority: high, content_available: true, to: kcF23gblKok...., collapse_key: do_not_collapse, from: 7812....]
Can anyone suggest me the correct format of payload?