Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
- {
- #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0 //__IPHONE_8_0 is not defined in old xcode (==0). Then use 80000
- NSLog(@"registerForPushNotification: For iOS >= 8.0");
- [[UIApplication sharedApplication] registerUserNotificationSettings:
- [UIUserNotificationSettings settingsForTypes:
- (UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge)
- categories:nil]];
- [[UIApplication sharedApplication] registerForRemoteNotifications];
- #endif
- }
- else {
- NSLog(@"registerForPushNotification: For iOS < 8.0");
- [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
- (UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement