Skip to content

Commit

Permalink
remove checkPermission functions in order to use from PR #69
Browse files Browse the repository at this point in the history
  • Loading branch information
EJohnF committed Feb 26, 2019
1 parent 61a1e7c commit 181f4fa
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
22 changes: 0 additions & 22 deletions RCTAppleHealthKit/RCTAppleHealthKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ @implementation RCTAppleHealthKit
[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];
Expand Down Expand Up @@ -286,23 +281,6 @@ - (void)initializeHealthKit:(NSDictionary *)input callback:(RCTResponseSenderBlo
}
}

- (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 = @{
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ AppleHealthKit.initHealthKit(options: Object, (err: string, results: Object) =>
* Base Methods
* [isAvailable](/docs/isAvailable().md)
* [initHealthKit](/docs/initHealthKit().md)
* checkSharePermission
* Realtime Methods
* [initStepCountObserver](/docs/initStepCountObserver().md)
* [setObserver](/docs/setObserver().md)
Expand Down

0 comments on commit 181f4fa

Please sign in to comment.