---
name: "onMqttMessageReceived"
mode: "kit"
versionRequirements:
  - { name: "DeviceKit", version: "1.2.6" }
platform:
  - "iOS"
  - "Android"
async: true
---

## onMqttMessageReceived

> [VERSION] DeviceKit >= 1.2.6

> [PLATFORM] iOS, Android

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

### Description

MQTT channel message report

### Parameters

`(listener: Function)`

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

### 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` | Message data normalized between app and device |
| `type` | `string` | `1.2.6` | Message type |
| `protocol` | `number` | `1.2.6` | Protocol ID |
| `topic` | `string` | `2.5.1` | topic |
