From 1825429154b2313b0454b048fc6cfc90fe6b3ba2 Mon Sep 17 00:00:00 2001 From: Greg Wilson Date: Sat, 9 Jul 2016 14:38:39 -0400 Subject: [PATCH] update readme --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 48c600e..46194f3 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,32 @@ The available HealthKit permissions to use with `initHealthKit` | AppleExerciseTime | [HKQuantityTypeIdentifierAppleExerciseTime](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifierappleexercisetime?language=objc) | ✓ | | | DietaryEnergy | [HKQuantityTypeIdentifierDietaryEnergyConsumed](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifierdietaryenergyconsumed?language=objc) | ✓ | ✓ | +These permissions are exported as constants of the `react-native-apple-healthkit` module. + +```javascript +import AppleHealthKit from 'react-native-apple-healthkit'; + +... + +// get the available permissions from AppleHealthKit.Constants object +const PERMS = AppleHealthKit.Constants.Permissions; + +// setup healthkit read/write permissions from PERMS +const healthKitOptions = { + permissions: { + read: [ + PERMS.StepCount, + PERMS.Height, + ], + write: [ + PERMS.StepCount + ], + } +}; + +... +``` + Options ------- -- 2.26.2