diff --git a/src/ios/HealthKit.m b/src/ios/HealthKit.m index 3fdd3824..d531d0a5 100755 --- a/src/ios/HealthKit.m +++ b/src/ios/HealthKit.m @@ -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) {