最完善的做法就是,进行两者兼容 iOS7下的也要兼容, iOS7以上的我更要兼容啦,最完善的做法
#define IOS8 ([[[UIDevice currentDevice] systemVersion] doubleValue] >=8.0 ? YES : NO)
if (IOS8) { //iOS8以上 if ([[UIApplication sharedApplication] currentUserNotificationSettings].types == UIRemoteNotificationTypeNone) {
}
}else{ // ios7 一下
if ([[UIApplication sharedApplication] enabledRemoteNotificationTypes] == UIRemoteNotificationTypeNone) {
}
}
跳转设置 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];