Skip to content

Commit 81c075f

Browse files
committed
- Added save insulin delivery sample documentation
1 parent 40683d5 commit 81c075f

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

docs/saveInsulinDeliverySample.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# saveBloodGlucoseSample
2+
3+
Save a insulin delivery value to HealthKit.
4+
5+
`saveInsulinDeliverySample` accepts an options object containing insulin sample data and a callback:
6+
7+
Example input object:
8+
9+
```javascript
10+
let input = {
11+
value: 10, // IU
12+
startDate: '2021-03-22T16:19:00.000-0300', // Optional, defaults to now
13+
endDate: '2021-03-22T16:19:00.000-0300', // Optional, defaults to startDate
14+
metadata: {
15+
HKBloodGlucoseMealTime: 1, //Basal = 1, Bolus = 2
16+
anyOtherKey: 'some data', // supports string, number, boolean
17+
}
18+
}
19+
```
20+
21+
Insulin delivery samples are always in International Units.
22+
23+
Example usage:
24+
25+
```javascript
26+
AppleHealthKit.saveInsulinDeliverySample(
27+
input,
28+
(err: Object, result: string) => {
29+
if (err) {
30+
return
31+
}
32+
// insulin delivery successfully saved
33+
console.log(result)
34+
},
35+
)
36+
```
37+
38+
Example output (record's UUID):
39+
40+
```json
41+
"619E37D3-C675-4186-B6A4-395EBFC6F46D"
42+
```

0 commit comments

Comments
 (0)