From 66d0d62565598d11436785e16cec9f2e38b4a3b4 Mon Sep 17 00:00:00 2001 From: Furyou81 Date: Thu, 23 May 2019 13:59:49 +0700 Subject: [PATCH] removing checkpermission --- RCTAppleHealthKit/RCTAppleHealthKit.m | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/RCTAppleHealthKit/RCTAppleHealthKit.m b/RCTAppleHealthKit/RCTAppleHealthKit.m index 3ff6c1a..df459c4 100644 --- a/RCTAppleHealthKit/RCTAppleHealthKit.m +++ b/RCTAppleHealthKit/RCTAppleHealthKit.m @@ -39,11 +39,6 @@ RCT_EXPORT_METHOD(initHealthKit:(NSDictionary *)input callback:(RCTResponseSende [self initializeHealthKit:input callback:callback]; } -RCT_EXPORT_METHOD(checkSharePermission:(NSString *)input callback:(RCTResponseSenderBlock)callback) -{ - [self checkPermission:input callback:callback]; -} - RCT_EXPORT_METHOD(initStepCountObserver:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback) { [self fitness_initializeStepEventObserver:input callback:callback]; @@ -291,23 +286,6 @@ RCT_EXPORT_METHOD(saveMindfulSession:(NSDictionary *)input callback:(RCTResponse } } -- (void)checkPermission:(NSString *)input callback:(RCTResponseSenderBlock)callback -{ - self.healthStore = [[HKHealthStore alloc] init]; - if ([HKHealthStore isHealthDataAvailable]) { - - HKObjectType *val = [[self writePermsDict] objectForKey:input]; - - if ([self.healthStore authorizationStatusForType:val] == HKAuthorizationStatusSharingAuthorized) { - callback(@[[NSNull null], @true]); - } else { - callback(@[[NSNull null], @false]); - } - } else { - callback(@[RCTMakeError(@"HealthKit data is not available", nil, nil)]); - } -} - - (void)getModuleInfo:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback { NSDictionary *info = @{ -- 2.26.2