From 2c59ecfec2d7b4c15d84f39d4be2bd9719a9dd6d Mon Sep 17 00:00:00 2001 From: Andreas Amsenius Date: Thu, 28 Feb 2019 14:19:12 +0100 Subject: [PATCH] Add documentation for authorizationStatusForType --- README.md | 1 + docs/authorizationStatusForType().md | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 docs/authorizationStatusForType().md diff --git a/README.md b/README.md index 0a385f8..baeea8b 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,7 @@ AppleHealthKit.initHealthKit(options: Object, (err: string, results: Object) => * Base Methods * [isAvailable](/docs/isAvailable().md) * [initHealthKit](/docs/initHealthKit().md) + * [authorizationStatusForType](/docs/authorizationStatusForType().md) * Realtime Methods * [initStepCountObserver](/docs/initStepCountObserver().md) * Read Methods diff --git a/docs/authorizationStatusForType().md b/docs/authorizationStatusForType().md new file mode 100644 index 0000000..b7e4a80 --- /dev/null +++ b/docs/authorizationStatusForType().md @@ -0,0 +1,15 @@ +Check the authorization status for sharing (writing) the specified data type. + +Status will be one of `"NotDetermined"`, `"SharingDenied"`, `"SharingAuthorized"`. + +```javascript +AppleHealthKit.authorizationStatusForType( + "initHealthKit", (error, status) => { + if (status) { + console.log("status is", status) + } + } +) +``` + +There is no way to check authorization status for read permission, [see this](https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatusfortype?language=objc). -- 2.26.2