I want to fetch Apple push notification payload without clicking on push notification that i have received when my app is in background. I want to get payload when i click on app icon and app comes to foreground.
I can get payload if i click on notification. But this is not what i want.
I just want a hint if it is possible to get payload without clicking push notification.
Update
i have set UIBackgroundModes as
"Required background modes" and added "App downloads content in response to push notifications" in its value.
now,
I have implemented below method in my appdelegate.m file. But i am unable to get userInfo. This methods doesn't get call on receiving APNS.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))handler
{
NSLog(@"userInfo :: %@",userInfo);
//Success
handler(UIBackgroundFetchResultNewData);
}