getLatestWeight().md 682 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
Get the most recent weight sample.

On success, the callback function will be provided with a `weight` object containing the weight `value`, and the `startDate` and `endDate` of the weight sample. *Note: startDate and endDate will be the same as weight samples are saved at a specific point in time.*

```javascript
let options = {
  unit: 'pound'
};
```

```javascript
Terrillo Walls's avatar
Terrillo Walls committed
12
AppleHealthKit.getLatestWeight(options, (err: string, results: Object) => {
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
  if (err) {
    console.log("error getting latest weight: ", err);
    return;
  }
  console.log(results)
});
```

```javascript
{
	value: 200,
	startDate: '2016-07-08T12:00:00.000-0400',
	endDate: '2016-07-08T12:00:00.000-0400'
}
```