authStatusPermissionsSync(params: Object)
Requires:
HealthKit≥5.18.3@ray-js/ray≥1.6.17
Platforms:
iOS
Description
Check whether the user has granted read and write permissions for Quantity data types [iOS only]
Parameters
| Property | Type | Required | Description | HealthKit Since |
|---|---|---|---|---|
permissions | string[] | No | Permission types (used by the API for requesting read/write permissions). See the enum list below for specific values e.g. ["1","2"] | v5.18.0 |
readPermissions | string[] | No | Read permission types (used by APIs that check whether the user has already authorized). See the enum list below for specific values e.g. ["1","2"] | v5.18.0 |
writePermissions | string[] | No | Write permission types (used by APIs that check whether the user has already authorized). See the enum list below for specific values e.g. ["1","2"] | v5.18.0 |
writePermission | number | No | Write permission types (used by APIs that check whether write permission is granted). See the enum list below for specific values | v5.18.0 |
value | number | No | Value to write (the specific measurement for data of type Quantity or Category) | v5.18.0 |
unitType | string | No | Unit to pass in, e.g., "mg/dL", "g", "cm", "count"; required when querying or writing Quantity-type data For unit mappings by data type, refer to Apple's official HKTypeIdentifiers.h file | v5.18.0 |
startTime | number | No | Start time, timestamp in seconds | v5.18.0 |
endTime | number | No | End time, timestamp in seconds | v5.18.0 |
type | number | No | Data types to read/write (used by data read/write APIs). See the enum list below for specific values | v5.18.0 |
Return Value
Type: Object↓
| Property | Type | Description | HealthKit Since |
|---|---|---|---|
value | number | Authorization status: 1 means all passed-in types have requested the corresponding read/write permissions; 0 means at least one has not been requested | v5.18.4 |
Error Code
| Error Code | Error Message |
|---|---|
1 | AppleHealthParamsError |