我已经添加了消息推送功能了的,可是我现在想去判断一下 用户在iPhone手机设置>通知里面有没有设置允许通知,在iOS7的系统上已经判断成功了 可是iOS8上面没有效果,具体代码:
if(isIOS8){
BOOL isRemoteNotify = [UIApplicationsharedApplication].isRegisteredForRemoteNotifications;
NSLog(@"-----------------%d",isRemoteNotify);
}
else{
UIRemoteNotificationType type = [[UIApplicationsharedApplication] enabledRemoteNotificationTypes];
int typeBadge = (type & UIRemoteNotificationTypeBadge);
int typeSound = (type & UIRemoteNotificationTypeSound);
int typeAlert = (type & UIRemoteNotificationTypeAlert);
BOOL ret = !typeBadge || !typeSound || !typeAlert;
NSLog(@"-----------------%d",ret);
}
在iOS下的布尔值始终为1;请大神指点一下