---
name: "authCharacteristicReadPermissionsSync"
mode: "kit"
versionRequirements:
  - { name: "HealthKit", version: "5.18.0" }
  - { name: "@ray-js/ray", version: "1.6.17" }
platform:
  - "iOS"
title: "health.authCharacteristicReadPermissionsSync - Request Characteristic read permissions [iOS only]"
---

## authCharacteristicReadPermissionsSync

> [VERSION] HealthKit >= 5.18.0 | @ray-js/ray >= 1.6.17

> [PLATFORM] iOS

### Method signature

```typescript
authCharacteristicReadPermissionsSync(params: Object)
```

### Description

Request read permission for Characteristic data types [iOS only]

### Parameters

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `permissions` | `string[]` | No | - | Permission types (used by the API that requests read/write permissions). See the enum list below for values. e.g. ["1","2"] |
| `readPermissions` | `string[]` | No | - | Read permission types (used by the API that checks whether the user has granted authorization). See the enum list below for 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 measurement value for Quantity or Category data types) |
| `unitType` | `string` | No | - | Unit to pass in, e.g., "mg/dL", "g", "cm", "count"; required when querying or writing Quantity data. Refer to Apple's official HKTypeIdentifiers.h for the units corresponding to each data type. |
| `startTime` | `number` | No | - | Start time, Unix timestamp (seconds) |
| `endTime` | `number` | No | - | End time, Unix timestamp (seconds) |
| `type` | `number` | No | - | Data types to read/write (used by data read/write APIs); see the enum list below for specific values |

### Error Codes

| Error Code | Error Message |
| --- | --- |
| `1` | AppleHealthParamsError |

### Examples

#### Request read permission for biological sex data

```tsx
import { health } from '@ray-js/ray'

const endTime = Math.floor(Date.now() / 1000);
const startTime = endTime - 60 * 60;

health.authCharacteristicReadPermissions({
  permissions: ["1"],
  readPermissions: ["1"],
  writePermissions: ["1"],
  writePermission: 1,
  value: 65.5,
  unitType: "count",
  startTime,
  endTime,
  type: 1,
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});
```
