Push notification code after the IOS8 version
[[UIApplication sharedapplication] registerusernotificationsettings:[uiusernotificationsettings settingsForTypes :(Uiusernotificationtypesound | Uiusernotificationtypealert | Uiusernotificationtypebadge) Categories:nil];
Note the following sentence, in IOS8 to register the push notification must be added [[UIApplication sharedapplication] registerforremotenotifications];
Previous push notification code for the IOS8 version
[[UIApplication Sharedapplication] registerforremotenotificationtypes: (Uiusernotificationtypebadge | Uiusernotificationtypesound | Uiusernotificationtypealert)];
If you want to be compatible with both iOS7 and iOS8, my personal code is as follows:
if ([[[Uidevice Currentdevice] systemversion] floatvalue] >= 8.0)
{
[[UIApplication sharedapplication] registerusernotificationsettings:[uiusernotificationsettings settingsForTypes :(Uiusernotificationtypesound | Uiusernotificationtypealert | Uiusernotificationtypebadge) Categories:nil];
[[UIApplication sharedapplication] registerforremotenotifications];
}
Else
{
[[UIApplication Sharedapplication] registerforremotenotificationtypes: (Uiusernotificationtypebadge | Uiusernotificationtypesound | Uiusernotificationtypealert)];
}
iOS8The horizontal status bar does not display
Workaround: In the plist file, set the View controller-based status bar appearance to No in the Application:didfinishlaunchingwithoptions: Add the following code [ [UIApplication sharedapplication] Setstatusbarhidden:yes Withanimation:uistatusbaranimationnone];
[[UIApplication sharedapplication] Setstatusbarhidden:no Withanimation:uistatusbaranimationnone];
iOS8Horizontal screen when the system is hidden by default. This isiOS8New features
Map
friends share share to attention point
IOS7, iOS8 the difference between push notifications