Running with XCODE6 will find log hint: Registerforremotenotificationtypes:is not supported in IOS 8.0 and later
IOS 8 have changed notification registration in a non-backwards compatible the. While your need to support IOS 7 and 8 (and while apps built with the 8 SDK aren ' t accepted), you can check for the Selecto RS need and conditionally call them correctly for the running version. Here's a category on uiapplication that'll hide this logic behind a clean interface for you that'll work in both Xcode 5 and Xcode 6
Workaround:
// ios8
if ([[[uidevice currentdevice] systemversion] floatvalue] >= 8.0) {
[[UIApplication sharedApplication] registerusernotificationsettings:[uiusernotificationsettings
Settingsfortypes: (uiusernotificationtypesound | uiusernotificationtypealert | Uiusernotificationtypebadge)
Categories:nil]];
[[UIApplication sharedApplication] registerForRemoteNotifications];
} else {
//original code
[[UIApplication Sharedapplication] registerforremotenotificationtypes:
( Uiusernotificationtypebadge | uiusernotificationtypesound | uiusernotificationtypealert)];
}
Originally in IOS7 The method to determine if push is open is:
{
Uiremotenotificationtype types = [[UIApplication sharedapplication] enabledremotenotificationtypes];
Return (types & Uiremotenotificationtypealert);
}
In IOS8, use the following code:
{
Uiremotenotificationtype types;
if ([[[[Uidevice Currentdevice] systemversion] floatvalue] >= 8.0) {
types = [[UIApplication sharedapplication] currentusernotificationsettings].types;
} else {
types = [[UIApplication sharedapplication] enabledremotenotificationtypes];
}
Return (types & Uiremotenotificationtypealert);
}
IOS 8 Notification Settings page does not find an issue with the app