Skip to content

Instantly share code, notes, and snippets.

@matzew
Created February 20, 2014 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matzew/9113816 to your computer and use it in GitHub Desktop.
Save matzew/9113816 to your computer and use it in GitHub Desktop.
// When the program is in the foreground, this callback receives the Payload of the received Push Notification message
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
// 'userInfo' contains information related to the remote notification.
//NSString *alertValue = [userInfo valueForKeyPath:@"aps.alert"];
NSLog(@"\nForeground: %@\n", userInfo);
}
// Uncomment if you want to support 'silent' Push Notifications.
// NOTE: Ensure that 'Remote notifications' capability is enabled on the app target.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
NSLog(@"\nBackground: %@\n", userInfo);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment