getSaveQuantityPermission(params: Object)
Requires:
HealthKit≥5.18.3@ray-js/ray≥1.6.17
Platforms:
iOS
Description
Check whether the user has write permission for the specified Quantity data type [iOS only]
Parameters
| Property | Type | Required | Description |
|---|---|---|---|
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"] |
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"] |
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"] |
writePermission | number | No | Write permission types (used by APIs that check whether write permission is granted). See the enum list below for specific values |
value | number | No | Value to write (the specific measurement for data of type Quantity or Category) |
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 |
startTime | number | No | Start time, timestamp in seconds |
endTime | number | No | End time, timestamp in seconds |
type | number | No | Data types to read/write (used by read/write APIs); see the enum list below for values |
complete | () => void | No | Completion callback (executed on both success and failure) |
success | (params: Object) => void | No | Callback on successful API call |
fail | (params: Object) => void | No | Failure callback |
success callback parameters
| Property | Type | Description | HealthKit Since |
|---|---|---|---|
value | number | Write permission status: 1 - Has write permission; 0 - No write permission | v5.18.4 |
fail callback parameters
| Property | Type | Description |
|---|---|---|
errorMsg | string | Error message |
errorCode | string | number | Error code |
| Error extension |
Return Value
None
Error Code
| Error Code | Error Message |
|---|---|
1 | AppleHealthParamsError |