首页 新闻 会员 周边

关于iOS8推送判断

0
悬赏园豆:20 [已关闭问题] 关闭于 2015-04-15 17:13

我已经添加了消息推送功能了的,可是我现在想去判断一下   用户在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;请大神指点一下

一切都很淡然的主页 一切都很淡然 | 初学一级 | 园豆:151
提问于:2014-12-09 16:59
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册