diff --git a/README.md b/README.md index 7972a6f49ec93f5aa33858a95506e5340a9294dd..fa4e17c0e4d574e3f4b2a3aec826ea37fde7a47a 100644 --- a/README.md +++ b/README.md @@ -417,22 +417,28 @@ ___ 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`. + ```javascript let options = { - unit: 'mile', // optional; default 'meter' - date: (new Date(2016,5,1)).toISOString(), // optional; default now + unit: 'mile', // optional; default 'meter' + date: (new Date(2016,5,1)).toISOString(), // optional; default now }; -``` -```javascript AppleHealthKit.getDistanceWalkingRunning(options: Object, (err: Object, res: Object) => { if(this._handleHKError(err, 'getDistanceWalkingRunning')){ return; } - // use res.value ... }); ``` +```javascript +{ + value: 200, + startDate: '2016-07-08T12:00:00.000-0400', + endDate: '2016-07-08T12:00:00.000-0400' +} +``` + ___ #### **`getDistanceCycling`** @@ -489,6 +495,7 @@ AppleHealthKit.initHealthKit(null: Object, (err: string, res: Object) => { let options = { unit: 'pound' }; + AppleHealthKit.getLatestWeight(options, (err: string, weight: Object) => { if (err) { console.log("error getting latest weight: ", err);