readCharacteristicDataWithTypeSync(params: Object)
Requires:
HealthKit≥5.18.0@ray-js/ray≥1.6.17
Platforms:
iOS
Description
Read Characteristic health data by type [iOS only]
Parameters
| Property | Type | Required | Description |
|---|---|---|---|
permissions | string[] | No | Permission types (used by the API to request read/write permissions). See the enum list below for specific values. e.g., ["1","2"] |
readPermissions | string[] | No | Read permission types (used by the API that checks 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 the API that checks 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 the API that checks whether write permission is granted). See the enum list below for specific values. |
value | number | No | Value to write (the specific measurement for Quantity or Category data types). |
unitType | string | No | Unit to pass in, e.g., "mg/dL", "g", "cm", "count"; required when querying and writing Quantity-type data. For the unit applicable to each data type, refer to Apple's HKTypeIdentifiers.h. |
startTime | number | No | Start time, Unix timestamp in seconds |
endTime | number | No | End time, Unix timestamp in seconds |
type | number | No | Data type to read/write (used by read/write APIs); see the enum list below for values |
Return Value
Type: Object↓
| Property | Type | Description | HealthKit Since |
|---|---|---|---|
| The data read is an array; each item is a dictionary defined as follows value: Integer The value read; see Apple's official documentation for its meaning startDate: Double The start timestamp of the entry endDate: Double The end timestamp of the entry | v5.18.4 |
Error Code
| Error Code | Error Message |
|---|---|
1 | AppleHealthParamsError |