Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 673 Bytes

saveWater.md

File metadata and controls

33 lines (25 loc) · 673 Bytes

saveWater

Add a specified amount of consumed water to Healthkit

saveWater accepts an options object containing a numeric water value in liters. In the example below 200 ml of water are added to Healthkit.

Example input options:

let options = {
  value: 0.2, // Amount in liters
  date: (new Date(2018,10,1)).toISOString(), // Optional, time when the water amount was consumed
}

Call the method:

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

Example output:

1