美文网首页
iOS10推送是否打开判断

iOS10推送是否打开判断

作者: 微笑了 | 来源:发表于2016-11-03 15:50 被阅读0次

    首先导入#import <UserNotifications/UserNotifications.h>

    [[UNUserNotificationCenter currentNotificationCenter] getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) {

    if (settings.authorizationStatus == UNAuthorizationStatusNotDetermined)

    {

    NSLog(@"未选择---没有选择允许或者不允许,按不允许处理");

    }else if (settings.authorizationStatus == UNAuthorizationStatusDenied){

    NSLog(@"未授权--不允许推送");

    }else if (settings.authorizationStatus == UNAuthorizationStatusAuthorized){

    NSLog(@"已授权--允许推送");

    }];

    相关文章

      网友评论

          本文标题:iOS10推送是否打开判断

          本文链接:https://www.haomeiwen.com/subject/iozbuttx.html