metaflowltd / flutter_health_fit

A flutter plugin for using Apple HealthKit and Google Fit.
Other
88 stars 33 forks source link

How to ignore manual entries? #68

Open dokumanx opened 2 years ago

dokumanx commented 2 years ago

Hi folks,

Is there any way to ignore manual entries? Our users should not be able to add entries or we should not count them.

mirkancal commented 2 years ago
 let predicate = NSPredicate(format: "metadata.%K != YES", HKMetadataKeyWasUserEntered)

let query = HKStatisticsCollectionQuery(quantityType: quantityType,
                                                quantitySamplePredicate: nil,
                                                quantitySamplePredicate: predicate,
                                                options: options,
                                                anchorDate: anchorDate,
                                                intervalComponents: interval)