---
name: "offDeviceOnlineStatusUpdate"
mode: "kit"
versionRequirements:
  - { name: "DeviceKit", version: "1.2.7" }
  - { name: "@ray-js/ray", version: "0.6.23" }
platform:
  - "iOS"
  - "Android"
async: true
---

## offDeviceOnlineStatusUpdate

> [VERSION] DeviceKit >= 1.2.7 | @ray-js/ray >= 0.6.23

> [PLATFORM] iOS, Android

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

### Description

Device online/offline status change

### Parameters

`(listener: Function)`

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `listener` | `(params: Online) => void` | Yes | - |  |

### Referenced Types

##### `interface` Online

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `online` | `boolean` | `1.2.6` | Online status |
| `deviceId` | `string` | `1.2.6` | Device ID |
| `onlineType` | `number` | `1.2.6` | Device network online types, represented by bitwise flags; multiple states can be combined. Definitions: bit 0 (1 << 0): Wi-Fi online (Cloud online \|\| LAN online). To check only cloud online, use bit 7 bit 1 (1 << 1): Local online (LAN online) bit 2 (1 << 2): BLE online bit 3 (1 << 3): BLEMesh online bit 4 (1 << 4): beacon online bit 5 (1 << 5): Dayu online bit 6 (1 << 6): System BT Online bit 7 (1 << 7): Cloud online bit 8 (1 << 8): Matter online (local) |


### Examples

#### Basic usage

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

const { offDeviceOnlineStatusUpdate } = device;

offDeviceOnlineStatusUpdate((res) => {
  console.log('offDeviceOnlineStatusUpdate', res);
});
```
