首页 新闻 会员 周边

iOS怎么判断用户是否打开了系统设置里面推送通知的开关呢?

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

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 ]是弹出警告框的

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