2016-02-24 获取设备 通知开关

if ([[UIDevice currentDevice].systemVersion floatValue]>=8.0f) {
UIUserNotificationSettings *setting = [[UIApplication sharedApplication] currentUserNotificationSettings];
if (UIUserNotificationTypeNone == setting.types) {
NSLog(@"推送关闭8");
xiaoxi=@"已关闭";
}else{
NSLog(@"推送打开8");
xiaoxi=@"已打开";
}
}else{
UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
if(UIRemoteNotificationTypeNone == type){
xiaoxi=@"已关闭";
}else{
xiaoxi=@"已打开";
}
}

 

 

posted @ 2016-02-24 13:52  zhen_zhen  阅读(119)  评论(0编辑  收藏  举报