线上所有马甲包模板,与《猎豆》同UI。域名zhuadd

HSQAuthorityManager.m 1013B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // HSQAuthorityManager.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/1/25.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "HSQAuthorityManager.h"
  9. #import <Photos/Photos.h>
  10. @implementation HSQAuthorityManager
  11. +(BOOL)isObtainUserNotificationAuthority{
  12. BOOL isOpen = NO;
  13. #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0
  14. UIUserNotificationSettings *setting = [[UIApplication sharedApplication] currentUserNotificationSettings];
  15. if (setting.types != UIUserNotificationTypeNone) {
  16. isOpen = YES;
  17. }
  18. #else
  19. UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
  20. if (type != UIRemoteNotificationTypeNone) {
  21. isOpen = YES;
  22. }
  23. #endif
  24. return isOpen;
  25. }
  26. + (BOOL)CanPhotoLibary{
  27. PHAuthorizationStatus authStatus = [PHPhotoLibrary authorizationStatus];
  28. if (authStatus == PHAuthorizationStatusAuthorized) {
  29. return NO;
  30. }else{
  31. return YES;
  32. }
  33. }
  34. @end