Commit 6e59b7d6 authored by Terrillo Walls's avatar Terrillo Walls

DistanceWalkingRunning docs update

parent 90f00ed7
...@@ -417,22 +417,28 @@ ___ ...@@ -417,22 +417,28 @@ ___
Get the total distance walking/running on a specific day. Get the total distance walking/running on a specific day.
`getDistanceWalkingRunning` accepts an options object containing optional *`date: ISO8601Timestamp`* and *`unit: string`*. If `date` is not provided it will default to the current time. `unit` defaults to `meter`. `getDistanceWalkingRunning` accepts an options object containing optional *`date: ISO8601Timestamp`* and *`unit: string`*. If `date` is not provided it will default to the current time. `unit` defaults to `meter`.
```javascript ```javascript
let options = { let options = {
unit: 'mile', // optional; default 'meter' unit: 'mile', // optional; default 'meter'
date: (new Date(2016,5,1)).toISOString(), // optional; default now date: (new Date(2016,5,1)).toISOString(), // optional; default now
}; };
```
```javascript
AppleHealthKit.getDistanceWalkingRunning(options: Object, (err: Object, res: Object) => { AppleHealthKit.getDistanceWalkingRunning(options: Object, (err: Object, res: Object) => {
if(this._handleHKError(err, 'getDistanceWalkingRunning')){ if(this._handleHKError(err, 'getDistanceWalkingRunning')){
return; return;
} }
// use res.value ...
}); });
``` ```
```javascript
{
value: 200,
startDate: '2016-07-08T12:00:00.000-0400',
endDate: '2016-07-08T12:00:00.000-0400'
}
```
___ ___
#### **`getDistanceCycling`** #### **`getDistanceCycling`**
...@@ -489,6 +495,7 @@ AppleHealthKit.initHealthKit(null: Object, (err: string, res: Object) => { ...@@ -489,6 +495,7 @@ AppleHealthKit.initHealthKit(null: Object, (err: string, res: Object) => {
let options = { let options = {
unit: 'pound' unit: 'pound'
}; };
AppleHealthKit.getLatestWeight(options, (err: string, weight: Object) => { AppleHealthKit.getLatestWeight(options, (err: string, weight: Object) => {
if (err) { if (err) {
console.log("error getting latest weight: ", err); console.log("error getting latest weight: ", err);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment