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

## getSystemInfo

> [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.

### Description

Get system information

### Parameters

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `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 |
| --- | --- | --- | --- |
| `is24Hour` | `boolean` | `3.2.6` | Whether 24-hour format is used |
| `system` | `string` | `3.2.6` | OS and version |
| `brand` | `string` | `3.2.6` | Device brand |
| `model` | `string` | `3.2.6` | Device model |
| `platform` | `string` | `3.2.6` | System type, e.g., ios, android, harmony |
| `timezoneId` | `string` | `3.2.6` | Time zone ID |
| `pixelRatio` | `number` | `3.2.6` | Device pixel ratio |
| `screenWidth` | `number` | `3.2.6` | Screen width in logical pixels, e.g., 411 |
| `screenHeight` | `number` | `3.2.6` | Screen height in logical pixels, e.g., 914 |
| `windowWidth` | `number` | `3.2.6` | Window width in logical pixels, e.g., 411 |
| `windowHeight` | `number` | `3.2.6` | Window height in logical pixels, e.g., 914 |
| `useableWindowWidth` | `number` | `3.3.2` | Available window width in logical pixels, e.g., 411 |
| `useableWindowHeight` | `number` | `3.3.2` | Available window height in logical pixels, e.g., 814 |
| `statusBarHeight` | `number` | `3.2.6` | Status bar height in logical pixels, e.g., 34 |
| `language` | `string` | `3.2.6` | Current language |
| `safeArea` | `SafeArea` | `3.2.6` | Safe area information; fields are in logical pixels, e.g., { left: 0, right: 411, top: 34, bottom: 898, width: 411, height: 864 } |
| `albumAuthorized` | `boolean` | `3.2.6` | Whether access to the photo album is allowed |
| `cameraAuthorized` | `boolean` | `3.2.6` | Whether camera access is allowed |
| `locationAuthorized` | `boolean` | `3.2.6` | Whether location access is allowed |
| `microphoneAuthorized` | `boolean` | `3.2.6` | Whether microphone access is allowed |
| `notificationAuthorized` | `boolean` | `3.2.6` | Whether sending notifications is allowed |
| `notificationAlertAuthorized` | `boolean` | `3.2.6` | Whether notification alerts are allowed |
| `notificationBadgeAuthorized` | `boolean` | `3.2.6` | Whether notification badges are allowed |
| `notificationSoundAuthorized` | `boolean` | `3.2.6` | Whether notification sounds are allowed |
| `bluetoothEnabled` | `boolean` | `3.2.6` | Whether Bluetooth is enabled |
| `locationEnabled` | `boolean` | `3.2.6` | Whether location services are enabled |
| `wifiEnabled` | `boolean` | `3.2.6` | Whether Wi-Fi is enabled |
| `theme` | `"dark" \| "light"` | `3.2.6` | Current theme |
| `deviceOrientation` | `"portrait" \| "landscape"` | `3.2.6` | Current screen orientation |
| `deviceLevel` | `string` | `3.3.3` | Device level (low: low - middle: middle - high: high) |
| `isSupportPinShortcut` | `boolean` | `3.5.0` | Whether the phone OS supports creating shortcuts (Android only) |
| `deviceType` | `string` | `3.10.6` | Device type phone: Phone pad: Tablet |

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


### Referenced Types

##### `interface` SafeArea

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `left` | `number` | `3.2.6` | Left inset Left boundary of the safe area, in logical pixels; for example, returns 0 |
| `right` | `number` | `3.2.6` | Right inset Right boundary of the safe area, in logical pixels; for example, returns 411 |
| `top` | `number` | `3.2.6` | Top inset Top boundary of the safe area, in logical pixels; for example, returns 34 |
| `bottom` | `number` | `3.2.6` | Bottom inset Bottom boundary of the safe area, in logical pixels; for example, returns 898 |
| `width` | `number` | `3.2.6` | Safe area width in logical pixels; for example, returns 411 |
| `height` | `number` | `3.2.6` | Safe area height in logical pixels; for example, returns 864 |


### Valid Values

##### `success.theme` valid values

| Value | Description |
| --- | --- |
| `"dark"` | Dark mode |
| `"light"` | Light mode |

##### `success.deviceOrientation` valid values

| Value | Description |
| --- | --- |
| `"portrait"` | Portrait |
| `"landscape"` | Landscape |


### Examples

#### Demo

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

getSystemInfo({
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});
```
