Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
optional filtered flag to ignore manual steps, fix dariosalvi78#105
  • Loading branch information
aggarwalankush authored Mar 13, 2018
1 parent 96e0cc5 commit 363a3bc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ios/HealthKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -1504,6 +1504,11 @@ - (void)querySampleTypeAggregated:(CDVInvokedUrlCommand *)command {

// NSPredicate *predicate = [HKQuery predicateForSamplesWithStartDate:startDate endDate:endDate options:HKQueryOptionStrictStartDate];
NSPredicate *predicate = nil;

BOOL filtered = (args[@"filtered"] != nil && [args[@"filtered"] boolValue]);
if (filtered) {
predicate = [NSPredicate predicateWithFormat:@"metadata.%K != YES", HKMetadataKeyWasUserEntered];
}

NSSet *requestTypes = [NSSet setWithObjects:type, nil];
[[HealthKit sharedHealthStore] requestAuthorizationToShareTypes:nil readTypes:requestTypes completion:^(BOOL success, NSError *error) {
Expand Down

0 comments on commit 363a3bc

Please sign in to comment.