Skip to content

Instantly share code, notes, and snippets.

@didats
Created September 30, 2014 13:34
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 didats/ab667c9d13cba29de4ff to your computer and use it in GitHub Desktop.
Save didats/ab667c9d13cba29de4ff to your computer and use it in GitHub Desktop.
Register Push Notification iOS 8
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
else
{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment