Skip to content

Instantly share code, notes, and snippets.

@nwg
Forked from imosquera/MyAppDelegate.m
Created January 24, 2012 18:37
Show Gist options
  • Save nwg/1671779 to your computer and use it in GitHub Desktop.
Save nwg/1671779 to your computer and use it in GitHub Desktop.
smart notifications
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken
{
[Socialize registerDeviceToken:deviceToken];
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
// Don't handle notifications when in the foreground
if (application.applicationState != UIApplicationStateActive) {
return;
}
// Give Socialize a chance to handle this notification if it needs to
if ([Socialize handleNotification:userInfo]) {
return;
}
// Nonsocialize notification handling goes here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment