From ca1c0bb0ea60d44d8ae73a1ee974510235a7ed7f Mon Sep 17 00:00:00 2001 From: Evstropov Evgenii Date: Mon, 29 Apr 2019 20:17:36 +0200 Subject: [PATCH] update docs according actual implementation --- docs/authorizationStatusForType().md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/authorizationStatusForType().md b/docs/authorizationStatusForType().md index 556aff0..8687b89 100644 --- a/docs/authorizationStatusForType().md +++ b/docs/authorizationStatusForType().md @@ -3,13 +3,14 @@ Check the authorization status for sharing (writing) the specified data type. Status will be one of `"NotDetermined"`, `"SharingDenied"`, `"SharingAuthorized"`. ```javascript -AppleHealthKit.authorizationStatusForType( - "StepCount", (error, status) => { - if (status) { - console.log("status is", status) - } - } -) +try { +const status = await AppleHealthKit.authorizationStatusForType("StepCount") +if (status) { + console.log("status is", status) +} +} catch (error) { + console.warn(error) +} ``` 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