com.awareframework.ios.sensor.healthkit 0.5.0

com.awareframework.ios.sensor.healthkit 0.5.0

Maintained by tetujin, yuuki.nishiyama.



  • By
  • Yuuki Nishiyama

AWARE: HealthKit

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

com.aware.ios.sensor.healthkit is available through CocoaPods.

  1. To install it, simply add the following line to your Podfile:
pod 'com.awareframework.ios.sensor.healthkit'
  1. com_aware_ios_sensor_healthkit library into your source code.
import com_awareframework_ios_sensor_healthkit
  1. Turn on HealthKit capbility on Xcode

  2. Add NSHealthShareUsageDescription into Info.plist

Example usage

let sensor = HealthKitSensor.init(HealthKitSensor.Config().apply{config in
    config.debug = true
    config.sensorObserver = Observer()
    config.isHeartRateFetch = true
})
sensor.start()
class Observer:HealthKitObserver {
    func onHealthKitAuthorizationStatusChanged(success: Bool, error: Error?) {
        // Your code here..
    }

    func onHeartRateDataChanged(data: [HealthKitHeartRateData]) {
        // Your code here..
    }
}

Author

Yuuki Nishiyama, [email protected]

License

Copyright (c) 2021 AWARE Mobile Context Instrumentation Middleware/Framework (http://www.awareframework.com)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.