iOS怎么判断用户是否打开了系统设置里面推送通知的开关 求大神指点........
我是这么判断的 但不管设置没设置都会弹出警告说没有设置
这是我用的方法
if(isIOS8){
BOOL isRemoteNotify = [UIApplicationsharedApplication].isRegisteredForRemoteNotifications;
[self shareNotificationCheck:!isRemoteNotify];
}
else{
UIRemoteNotificationType type = [[UIApplicationsharedApplication] enabledRemoteNotificationTypes];
int typeBadge = (type & UIRemoteNotificationTypeBadge);
int typeSound = (type & UIRemoteNotificationTypeSound);
int typeAlert = (type & UIRemoteNotificationTypeAlert);
BOOL ret = !typeBadge || !typeSound || !typeAlert;
[selfshareNotificationCheck:ret];
}
其中[self shareNotificationCheck:YES ]是弹出警告框的