---
name: "authorizeStatus"
mode: "kit"
versionRequirements:
  - { name: "BaseKit", version: "2.0.1" }
  - { name: "@ray-js/ray", version: "0.3.23" }
platform:
  - "iOS"
  - "Android"
async: true
---

## authorizeStatus

> [VERSION] BaseKit >= 2.0.1 | @ray-js/ray >= 0.3.23

> [PLATFORM] iOS, Android

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

### Method signature

```typescript
authorizeStatus(params: Object)
```

### Description

Query permission status

### Parameters

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `scope` | `"scope.bluetooth" \| "scope.record" \| "scope.writePhotosAlbum" \| "scope.camera" \| "scope.userLocation" \| "scope.userPreciseLocation" \| "scope.userLocationBackground" \| "scope.userInfo" \| "scope.calendar" \| "scope.nearByWifiDevice"` | No | `'scope.writePhotosAlbum'` | scope permission name |
| `complete` | `() => void` | No | - | Completion callback (executed on both success and failure) |
| `success` | `() => void` | No | - | Callback on successful API call |
| `fail` | `(params: Object) => void` ↓see below | No | - | Failure callback |

#### 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 |


### Valid Values

##### `scope`

| Value | Description | Since |
| --- | --- | --- |
| `scope.bluetooth` | Bluetooth permission | 3.17.4 |
| `scope.record` | Microphone permission | 3.17.4 |
| `scope.writePhotosAlbum` | Write permission | 3.17.4 |
| `scope.camera` | Camera permission | 3.17.4 |
| `scope.userLocation` | Low-accuracy location permission | 3.17.4 |
| `scope.userPreciseLocation` | High-accuracy location permission | 3.17.4 |
| `scope.userLocationBackground` | Background location permission Note: On iOS, enable TARGETS->Capabilities->Background Modes->Location updates | 3.17.4 |
| `scope.userInfo` | User information | 3.17.4 |
| `scope.calendar` | Calendar read/write permission | 3.32.13 |
| `scope.nearByWifiDevice` | Connect to nearby Wi-Fi devices, Android only | 3.32.13 |


### Examples

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

authorizeStatus({
  scope: "scope.writePhotosAlbum",
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});
```
