Maintenance of a program, when the phone upgrade to iOS8 can not receive a remote push, display registration failure, check the information, the original is not to obtain user permission, add a method to try the next, OK
if ([[[[Uidevice currentdevice]systemversion]integervalue] >= 8) { uiusernotificationsettings*setting = [ Uiusernotificationsettings settingsfortypes:uiusernotificationtypealert| uiusernotificationtypebadge| Uiusernotificationtypesound Categories:nil]; [Application registerusernotificationsettings:setting]; [Application registerforremotenotifications]; } else{ [Application registerforremotenotificationtypes:uiremotenotificationtypealert| uiremotenotificationtypebadge| Uiremotenotificationtypesound]; }
The registration method used for different versions of the system is not the same, the following is the instructions given by the Apple SDK:
-(void) Registerforremotenotificationtypes: (uiremotenotificationtype) Types Ns_deprecated_ios (3_0, 8_0, <span style= "COLOR: #FF0000;" > "Please use Registerforremotenotifications and registerusernotificationsettings:instead" </span>);
iOS (push remote push) upgraded to iOS8 system Some programs do not receive remote push