Created
August 20, 2014 10:03
-
-
Save thoretton-edwin/bd49f0752d60fc561d5f to your computer and use it in GitHub Desktop.
iOS 8 push notification diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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