---
name: "authStatusPermissions"
mode: "kit"
versionRequirements:
  - { name: "HealthKit", version: "5.18.3" }
  - { name: "@ray-js/ray", version: "1.6.17" }
platform:
  - "iOS"
async: true
title: "health.authStatusPermissions - Check whether authorization has already been requested for Quantity data [iOS only]"
---

## authStatusPermissions

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

> [PLATFORM] iOS

> ⚡ **Supports Promise** — Returns a Promise when success / fail / complete callbacks are omitted.

### Description

Check whether the user has granted read and write permissions for Quantity data types [iOS only]

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `permissions` | `string[]` | No | - | `5.18.3` | 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 | - | `5.18.3` | 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 | - | `5.18.3` | 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 | - | `5.18.3` | Write permission types (used by APIs that check whether write permission is granted). See the enum list below for specific values |
| `value` | `number` | No | - | `5.18.3` | Value to write (the specific measurement for data of type Quantity or Category) |
| `unitType` | `string` | No | - | `5.18.3` | 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 | - | `5.18.3` | Start time, timestamp in seconds |
| `endTime` | `number` | No | - | `5.18.3` | End time, timestamp in seconds |
| `type` | `number` | No | - | `5.18.3` | Data types to read/write (used by data read/write APIs). See the enum list below for specific values |
| `complete` | `() => void` | No | - | - | Completion callback (executed on both success and failure) |
| `success` | `(params: Object) => void` ↓see below | No | - | - | Callback on successful API call |
| `fail` | `(params: Object) => void` ↓see below | No | - | - | Failure callback |

#### success callback parameters

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `value` | `number` | `5.18.4` | Authorization status: 1 means all passed-in types have requested the corresponding read/write permissions; 0 means at least one has not been requested |

#### fail callback parameters

| Property | Type | Description |
| --- | --- | --- |
| `errorMsg` | `string` | Error message |
| `errorCode` | `string \| number` | Error code |
| `innerError` | `Object` | Error extension |

##### fail(params).innerError properties

| Property | Type | Description |
| --- | --- | --- |
| `errorCode` | `string \| number` | Error extension code |
| `errorMsg` | `string` | Error extension message |


### Error Codes

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

### Examples

#### Basic call

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

const { authStatusPermissions } = health;

authStatusPermissions({
  readPermissions: ['1', '2'],
  writePermissions: ['1', '2'],
  success: (result) => {
    console.log('authStatusPermissions value:', result.value);
  },
  fail: (error) => {
    console.log('authStatusPermissions fail', error.errorMsg);
  },
});
```
