Commit 77978c36 authored by Greg Wilson's avatar Greg Wilson

update readme

parent f388c49f
......@@ -26,6 +26,7 @@ A React Native bridge module for interacting with [Apple HealthKit] data.
* ~~[getStepCountForDay](#getstepcountforday)~~
* [getDailyStepCountSamples](#getdailystepcountsamples)
* ~~[getMultiDayStepCounts](#getmultidaystepcounts)~~
* [saveSteps](#savesteps)
* [getDistanceWalkingRunning](#getdistancewalkingrunning)
* [getDistanceCycling](#getdistancecycling)
* [getFlightsClimbed](#getflightsclimbed)
......@@ -367,6 +368,30 @@ the function will be called with an array of elements `res` containing date and
___
#### **`saveSteps`**
save a step count sample. a step count sample represents the number of steps during a specific period of time. a sample should be a precise as possible, with startDate and endDate representing the range of time the steps were taken in.
`saveSteps` accepts an options object containing required *`value: number`*, *`startDate: ISO8601Timestamp`*, and *`endDate: ISO8601Timestamp`*.
```javascript
// startDate and endDate are 30 minutes apart. this means the step count value occured within those 30 minutes.
let options = {
value: 100,
startDate: (new Date(2016,6,2,6,0,0)).toISOString(),
endDate: (new Date(2016,6,2,6,30,0)).toISOString()
};
```
```javascript
AppleHealthKit.saveSteps(options, (err, res) => {
if(this._handleHKError(err, 'saveSteps')){
return;
}
// step count sample successfully saved
});
```
___
#### **`getDistanceWalkingRunning`**
get the total distance walking/running on a specific day.
......
......@@ -108,7 +108,6 @@ class Home extends Component {
if(this._handleHKError(err, 'getDailyStepCountSamples')){
return;
}
console.log('res: ', res);
this.setState({stepHistory: res});
});
}
......
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