/**
* 检测本机是否允许APP推送
*
* @return YES:允许 NO:不允许
*/
+ (BOOL)isAllowedNotification {
// system >= iOS8
if (kSystemVersion >=8) {
UIUserNotificationSettings *setting = [[UIApplication sharedApplication] currentUserNotificationSettings];
if (UIUserNotificationTypeNone != setting.types) {
return YES;
}
} else {//iOS7
UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
if(UIRemoteNotificationTypeNone != type)
return YES;
}
return NO;
}