Example

findWorkouts()

Query for all workout data.

Example

$cordovaHealthKit.findWorkouts().then(function(v){},function(err){});

saveWorkout(workout)

Save a workout.

param

type

workout

Object

Workout must be of the form:

{'activityType':'HKWorkoutActivityTypeCycling',// HKWorkoutActivityType constant (https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKWorkout_Class/#//apple_ref/c/tdef/HKWorkoutActivityType)'quantityType':'HKQuantityTypeIdentifierDistanceCycling','startDate':newDate(),// mandatory'endDate':null,// optional, use either this or duration'duration':3600,// in seconds, optional, use either this or endDate'energy':300,//'energyUnit':'kcal',// J|cal|kcal'distance':11,// optional'distanceUnit':'km'// probably useful with the former param// 'extraData': "", // Not sure how necessary this is},

Example

$cordovaHealthKit.saveWorkout({'activityType':'HKWorkoutActivityTypeCycling',// HKWorkoutActivityType constant (https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKWorkout_Class/#//apple_ref/c/tdef/HKWorkoutActivityType)'quantityType':'HKQuantityTypeIdentifierDistanceCycling','startDate':newDate(),// mandatory'endDate':null,// optional, use either this or duration'duration':3600,// in seconds, optional, use either this or endDate'energy':300,//'energyUnit':'kcal',// J|cal|kcal'distance':11,// optional'distanceUnit':'km'// probably useful with the former param// 'extraData': "", // Not sure how necessary this is}).then(function(v){},function(err){});