From 54c832497329191f4fdd0839405159e201ecc838 Mon Sep 17 00:00:00 2001 From: Greg Wilson Date: Thu, 30 Jun 2016 18:22:36 -0400 Subject: [PATCH] updated readme --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 5dc4c2a..bc79682 100644 --- a/README.md +++ b/README.md @@ -306,6 +306,29 @@ AppleHealthKit.getLatestWeight(null, (err: string, weight: number) => { ___ +#### **`getWeightSamples`** +query for weight samples. the options object is used to setup a query to retrieve relevant samples. +```javascript +let options = { + unit: 'pound', // optional; default 'pound' + startDate: (new Date(2016,4,27)).toISOString(), // required + endDate: (new Date()).toISOString(), // optional; default now + ascending: false, // optional; default false + limit:10, // optional; default no limit +}; +``` + +```javascript +AppleHealthKit.getWeightSamples(options, (err: Object, samples: Array) => { + if(this._handleHealthKitError(err, 'getWeightSamples')){ + return; + } + // use samples ... +}); +``` + +___ + #### **`saveWeight`** save a numeric weight value to HealthKit -- 2.26.2