12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- //
- // HSQAuthorityManager.m
- // YouHuiProject
- //
- // Created by 小花 on 2018/1/25.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "HSQAuthorityManager.h"
- #import <Photos/Photos.h>
- @implementation HSQAuthorityManager
- +(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;
- }
- + (BOOL)CanPhotoLibary{
- PHAuthorizationStatus authStatus = [PHPhotoLibrary authorizationStatus];
- if (authStatus == PHAuthorizationStatusAuthorized) {
- return NO;
- }else{
-
- return YES;
-
- }
-
- }
- @end
|