HealthKitReporter

open class HealthKitReporter: ActivityReporter

Convenience class querying HealthKit and CoreMotion for activity data.

See HealthKit/README.md for detailed instructions.

  • Samples activity data in HealthKit (steps, flights climbed and active energy) and returns one HKQuantitySample per type in a callback. Uses c3_summaryOfSamplesOfTypeBetween(type:start:end:) on the receiver’s HKHealthStore instance.

    Declaration

    Swift

    open func retrieveHealthKitActivitySummary(startingAt start: Date, until: Date, callback: @escaping ((_ samples: [HKQuantitySample]?, _ error: Error?) -> Void))