// // DRAuthorityManager.m // YouHuiProject // // Created by 小花 on 2018/1/25. // Copyright © 2018年 kuxuan. All rights reserved. // #import "DRAuthorityManager.h" @implementation DRAuthorityManager +(BOOL)isObtainUserNotificationAuthority{ BOOL isOpen = NO; #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0 UIUserNotificationSettings *setting = [[UIApplication sharedApplication] currentUserNotificationSettings]; if (setting.types != UIUserNotificationTypeNone) { isOpen = YES; } #else UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes]; if (type != UIRemoteNotificationTypeNone) { isOpen = YES; } #endif return isOpen; } @end