diff --git a/README.md b/README.md index 0a385f8afe85979246b146061e6cafbba626e510..baeea8b2deeee5da70a867da41d7d5a5a57cfced 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 0000000000000000000000000000000000000000..b7e4a809c39703056f9dbdb904b5bac5a69381b1 --- /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).