Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 722 Bytes

saveHeartRateSample.md

File metadata and controls

33 lines (25 loc) · 722 Bytes

saveHeartRateSample

Save a Heart Rate sample to Healthkit

saveHeartRateSample accepts an options object containing a numeric heart rate value in Beats per minute (BPM). In the example below a heart rate sample of 72BPM is added to Healthkit.

Example input options:

let options = {
  value: 72, // Amount in BPM
  date: (new Date(2018,10,1)).toISOString(), // Optional, time when the Heart Rate was logged
}

Call the method:

AppleHealthKit.saveHeartRateSample((options: Object), (err: Object, results: boolean) => {
  if (err) {
    console.log('Error saving Heart Rate to Healthkit: ', err)
    return
  }
  // Heart Rate successfully saved
})

Example output:

1