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

## offMqttMessageReceived

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

MQTT message channel reporting

### Parameters

`(listener: Function)`

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

### Referenced Types

##### `interface` MqttResponse

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `deviceId` | `string` | `1.2.6` | Device ID |
| `message` | `Record<string, Record<string, any>>` | `1.2.6` | Raw message data |
| `messageData` | `Record<string, Record<string, any>>` | `2.3.1` | Normalized message data |
| `type` | `string` | `1.2.6` | Message type |
| `protocol` | `number` | `1.2.6` | Protocol number |
| `topic` | `string` | `2.5.1` | topic |


### Examples

#### Basic usage

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

const { offMqttMessageReceived } = device;

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