I recently upgraded one of my test iphones to iOS 8 and then upgraded the PUSH registration code as below (using xCode 6)
-(BOOL)hasNotificationsEnabled {
Runtime and old compiler safe options ... if you run in old xcode (5.0 or earlier)
// changes of API in iOS 8.0
- (void) registerForPushNotification
{
NSLog(@"registerForPushNotification");
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)];
}
}