Browse Source

注销杰里关于健康SDK的引用,并重新提交审核

master
公司电脑 1 year ago
parent
commit
d703350b79
  1. 216
      Pods/JLAuthorizationManager/JLAuthorizationManager/JLAuthorizationManager.m
  2. BIN
      tongxin.xcworkspace/xcuserdata/ecell.xcuserdatad/UserInterfaceState.xcuserstate
  3. 4
      tongxin/Info.plist

216
Pods/JLAuthorizationManager/JLAuthorizationManager/JLAuthorizationManager.m generated

@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
@import CoreLocation;
@import MediaPlayer;
@import Speech;//Xcode 8.0 or later
@import HealthKit;
//@import HealthKit;
@import Intents;
@import CoreBluetooth;
@ -30,102 +30,102 @@ @@ -30,102 +30,102 @@
#define IOS9 ([[[UIDevice currentDevice] systemVersion] doubleValue] >= 9.0)
#define IOS10 ([[[UIDevice currentDevice] systemVersion] doubleValue] >= 10.0)
@interface JLAuthorizationHealthManager : NSObject
//@interface JLAuthorizationHealthManager : NSObject
- (void)JL_requestHealthAuthorizationWithShareTypes:(nullable NSSet<HKSampleType *> *)typesToShare
readTypes:(nullable NSSet<HKObjectType *> *)typesToRead
authorizedHandler:(void(^)())authorizedHandler
unAuthorizedHandler:(void(^)())unAuthorizedHandler;
@end
@implementation JLAuthorizationHealthManager
- (void)JL_requestHealthAuthorizationWithShareTypes:(nullable NSSet<HKSampleType *> *)typesToShare
readTypes:(nullable NSSet<HKObjectType *> *)typesToRead
authorizedHandler:(void(^)())authorizedHandler
unAuthorizedHandler:(void(^)())unAuthorizedHandler{
//- (void)JL_requestHealthAuthorizationWithShareTypes:(nullable NSSet<HKSampleType *> *)typesToShare
// readTypes:(nullable NSSet<HKObjectType *> *)typesToRead
// authorizedHandler:(void(^)())authorizedHandler
// unAuthorizedHandler:(void(^)())unAuthorizedHandler;
//@end
//
//@implementation JLAuthorizationHealthManager
HKHealthStore *healthStore = [[HKHealthStore alloc] init];
__block BOOL shouldRequestAccess = NO;
if (typesToShare.count > 0) {
[typesToShare enumerateObjectsUsingBlock:^(HKObjectType * _Nonnull type, BOOL * _Nonnull stop) {
HKAuthorizationStatus authStatus = [healthStore authorizationStatusForType:type];
if (authStatus == HKAuthorizationStatusNotDetermined) {
shouldRequestAccess = YES;
*stop = YES;
}
}];
}else{
if (typesToRead.count > 0) {
[typesToRead enumerateObjectsUsingBlock:^(HKObjectType * _Nonnull type, BOOL * _Nonnull stop) {
HKAuthorizationStatus authStatus = [healthStore authorizationStatusForType:type];
if (authStatus == HKAuthorizationStatusNotDetermined) {
shouldRequestAccess = YES;
*stop = YES;
}
}];
}else{
NSAssert(!(typesToRead.count > 0), @"待请求的权限类型数组不能为空");
}
}
if (shouldRequestAccess) {
[healthStore requestAuthorizationToShareTypes:typesToShare readTypes:typesToRead completion:^(BOOL success, NSError * _Nullable error) {
if (success) {
dispatch_async(dispatch_get_main_queue(), ^{
authorizedHandler ? authorizedHandler() : nil;
});
}else{
dispatch_async(dispatch_get_main_queue(), ^{
unAuthorizedHandler ? unAuthorizedHandler() : nil;
});
}
}];
}else{
__block BOOL isAuthorized = NO;
if (typesToShare.count > 0) {
[typesToShare enumerateObjectsUsingBlock:^(HKSampleType * _Nonnull type, BOOL * _Nonnull stop) {
HKAuthorizationStatus authStatus = [healthStore authorizationStatusForType:type];
if (authStatus == HKAuthorizationStatusNotDetermined
|| authStatus == HKAuthorizationStatusSharingDenied) {
isAuthorized = NO;
}else{
isAuthorized = YES;
}
}];
}else{
if (typesToRead.count > 0) {
[typesToRead enumerateObjectsUsingBlock:^(HKObjectType * _Nonnull type, BOOL * _Nonnull stop) {
HKAuthorizationStatus authStatus = [healthStore authorizationStatusForType:type];
if (authStatus == HKAuthorizationStatusNotDetermined
|| authStatus == HKAuthorizationStatusSharingDenied) {
isAuthorized = NO;
}else{
isAuthorized = YES;
}
}];
}else{
NSAssert(!(typesToRead.count > 0), @"待请求的权限类型数组不能为空");
}
}
if (isAuthorized) {
authorizedHandler ? authorizedHandler() : nil;
}else{
unAuthorizedHandler ? unAuthorizedHandler() : nil;
}
}
}
@end
//- (void)JL_requestHealthAuthorizationWithShareTypes:(nullable NSSet<HKSampleType *> *)typesToShare
// readTypes:(nullable NSSet<HKObjectType *> *)typesToRead
// authorizedHandler:(void(^)())authorizedHandler
// unAuthorizedHandler:(void(^)())unAuthorizedHandler{
//
// HKHealthStore *healthStore = [[HKHealthStore alloc] init];
// __block BOOL shouldRequestAccess = NO;
// if (typesToShare.count > 0) {
//
// [typesToShare enumerateObjectsUsingBlock:^(HKObjectType * _Nonnull type, BOOL * _Nonnull stop) {
// HKAuthorizationStatus authStatus = [healthStore authorizationStatusForType:type];
// if (authStatus == HKAuthorizationStatusNotDetermined) {
// shouldRequestAccess = YES;
// *stop = YES;
// }
// }];
//
// }else{
// if (typesToRead.count > 0) {
//
// [typesToRead enumerateObjectsUsingBlock:^(HKObjectType * _Nonnull type, BOOL * _Nonnull stop) {
// HKAuthorizationStatus authStatus = [healthStore authorizationStatusForType:type];
// if (authStatus == HKAuthorizationStatusNotDetermined) {
// shouldRequestAccess = YES;
// *stop = YES;
// }
// }];
//
//
// }else{
// NSAssert(!(typesToRead.count > 0), @"待请求的权限类型数组不能为空");
// }
// }
//
// if (shouldRequestAccess) {
// [healthStore requestAuthorizationToShareTypes:typesToShare readTypes:typesToRead completion:^(BOOL success, NSError * _Nullable error) {
// if (success) {
// dispatch_async(dispatch_get_main_queue(), ^{
// authorizedHandler ? authorizedHandler() : nil;
// });
// }else{
// dispatch_async(dispatch_get_main_queue(), ^{
// unAuthorizedHandler ? unAuthorizedHandler() : nil;
// });
// }
// }];
// }else{
// __block BOOL isAuthorized = NO;
// if (typesToShare.count > 0) {
// [typesToShare enumerateObjectsUsingBlock:^(HKSampleType * _Nonnull type, BOOL * _Nonnull stop) {
// HKAuthorizationStatus authStatus = [healthStore authorizationStatusForType:type];
// if (authStatus == HKAuthorizationStatusNotDetermined
// || authStatus == HKAuthorizationStatusSharingDenied) {
// isAuthorized = NO;
// }else{
// isAuthorized = YES;
// }
// }];
// }else{
// if (typesToRead.count > 0) {
//
// [typesToRead enumerateObjectsUsingBlock:^(HKObjectType * _Nonnull type, BOOL * _Nonnull stop) {
// HKAuthorizationStatus authStatus = [healthStore authorizationStatusForType:type];
// if (authStatus == HKAuthorizationStatusNotDetermined
// || authStatus == HKAuthorizationStatusSharingDenied) {
// isAuthorized = NO;
// }else{
// isAuthorized = YES;
// }
// }];
//
// }else{
// NSAssert(!(typesToRead.count > 0), @"待请求的权限类型数组不能为空");
// }
// }
//
// if (isAuthorized) {
// authorizedHandler ? authorizedHandler() : nil;
// }else{
// unAuthorizedHandler ? unAuthorizedHandler() : nil;
// }
//
// }
//
//}
//@end
@interface JLAuthorizationManager ()<CLLocationManagerDelegate>
@ -226,19 +226,19 @@ @@ -226,19 +226,19 @@
}
}
- (void)JL_requestHealthAuthorizationWithShareTypes:(NSSet*)typesToShare
readTypes:(NSSet*)typesToRead
authorizedHandler:(void(^)())authorizedHandler
unAuthorizedHandler:(void(^)())unAuthorizedHandler{
JLAuthorizationHealthManager *healthManager = [JLAuthorizationHealthManager new];
[healthManager JL_requestHealthAuthorizationWithShareTypes:typesToShare
readTypes:typesToRead
authorizedHandler:authorizedHandler
unAuthorizedHandler:unAuthorizedHandler];
}
//- (void)JL_requestHealthAuthorizationWithShareTypes:(NSSet*)typesToShare
// readTypes:(NSSet*)typesToRead
// authorizedHandler:(void(^)())authorizedHandler
// unAuthorizedHandler:(void(^)())unAuthorizedHandler{
//
// JLAuthorizationHealthManager *healthManager = [JLAuthorizationHealthManager new];
// [healthManager JL_requestHealthAuthorizationWithShareTypes:typesToShare
// readTypes:typesToRead
// authorizedHandler:authorizedHandler
// unAuthorizedHandler:unAuthorizedHandler];
//
//
//}
#pragma mark - Photo Library
- (void)p_requestPhotoLibraryAccessWithAuthorizedHandler:(void(^)())authorizedHandler

BIN
tongxin.xcworkspace/xcuserdata/ecell.xcuserdatad/UserInterfaceState.xcuserstate generated

Binary file not shown.

4
tongxin/Info.plist

@ -148,10 +148,6 @@ @@ -148,10 +148,6 @@
<string>请为应用打开相机权限,以便使用二维码扫描功能</string>
<key>NSContactsUsageDescription</key>
<string>请为应用打开通讯录权限,以便使用联系人批量导入功能</string>
<key>NSHealthShareUsageDescription</key>
<string>App需要您的同意,才能访问健康分享</string>
<key>NSHealthUpdateUsageDescription</key>
<string>App需要您的同意,才能访问健康更新</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>是否允许在使用过程中获取您的定位信息用于查看位置信息</string>
<key>NSLocationAlwaysUsageDescription</key>

Loading…
Cancel
Save