if ([[UIDevice currentDevice].systemVersion floatValue]>=8.0f) {
UIUserNotificationSettings *setting = [[UIApplication sharedApplication] currentUserNotificationSettings];
if (UIUserNotificationTypeNone == setting.types) {
// NSLog(@"推送关闭");
}else{
// NSLog(@"推送打开");
}
}else{
UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
if(UIRemoteNotificationTypeNone == type){
// NSLog(@"推送关闭");
}else{
// NSLog(@"推送打开");
}
}
转载于:https://my.oschina.net/u/2556411/blog/601971