123456789101112131415161718192021222324252627282930 |
- //
- // KBAuthorityManager.m
- // YouHuiProject
- //
- // Created by 小花 on 2018/1/25.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "KBAuthorityManager.h"
- @implementation KBAuthorityManager
- +(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
|