When the user receives a notification, there are two possible outcome actions depending on the app state. The app is not running and user taps on push notification, then didFinishLaunching method get called but with notification info in launchOption parameter. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//Check if the app is trigger up by the Push notification
if ([launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]) {
NSDictionary* notificationInfo = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
}
} The app is running (in foreground or background), then below method get called - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
}