// // HCAuthorityManager.m // hc // // Created by hc on 2018/1/25. // Copyright © 2018年 hc. All rights reserved. // #import "HCAuthorityManager.h" @implementation HCAuthorityManager +(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