react-native-health icon indicating copy to clipboard operation
react-native-health copied to clipboard

Possibility to save Heart Rates?

Open AlbertoMeQ opened this issue 2 years ago • 1 comments

I cannot find a way to store Heart Rates with this library, just to retrieve them.

I would like to have something like:

let options = {
  value: 75, // BPM
  date: Date.now().toISOString()
}

AppleHealthKit.saveHeartRateSample(
  (options: HealthInputOptions),
  (err: Object, result: number) => {
    if (err) {
      console.log('error saving heart rate to Healthkit: ', err)
      return
    }
    // heart rate successfully saved
  },
)

Here is an idea on the possible implementation: https://stackoverflow.com/a/27268690/1214469 for Swift.

AlbertoMeQ avatar Sep 20 '21 10:09 AlbertoMeQ

hey @AlbertoMeQ, thanks for collaborating with the project. Feel free to open an PR for that.

macelai avatar Sep 20 '21 12:09 macelai