Nothing Special   »   [go: up one dir, main page]

Skip to content

Instantly share code, notes, and snippets.

@thoretton-edwin
Created August 20, 2014 10:03
Show Gist options
  • Save thoretton-edwin/bd49f0752d60fc561d5f to your computer and use it in GitHub Desktop.
Save thoretton-edwin/bd49f0752d60fc561d5f to your computer and use it in GitHub Desktop.
iOS 8 push notification diff
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
[application registerUserNotificationSettings:
[UIUserNotificationSettings settingsForTypes:
(UIUserNotificationTypeSound | UIUserNotificationTypeAlert) categories:nil]];
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
else
{
// deprecated in iOS 8
[application registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment