---
name: "offMqttMessageReceived"
mode: "kit"
versionRequirements:
  - { name: "DeviceKit", version: "1.2.7" }
  - { name: "@ray-js/ray", version: "0.6.23" }
platform:
  - "iOS"
  - "Android"
async: true
title: "offMqttMessageReceived - 移除监听：MQTT 消息通道消息上报"
---

## offMqttMessageReceived

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

> [PLATFORM] iOS, Android

> ⚡ **支持 Promise 调用** — 不传 success / fail / complete 回调时，该方法返回 Promise。

### 描述

MQTT消息通道消息上报

### 参数

`(listener: Function)`

| 参数 | 类型 | 必填 | 默认值 | 描述 |
| --- | --- | --- | --- | --- |
| `listener` | `(params: MqttResponse) => void` | 是 | - |  |

### 引用对象

##### `interface` MqttResponse

| 属性 | 类型 | 最低版本 | 描述 |
| --- | --- | --- | --- |
| `deviceId` | `string` | `1.2.6` | 设备 id |
| `message` | `Record<string, Record<string, any>>` | `1.2.6` | 原始消息数据 |
| `messageData` | `Record<string, Record<string, any>>` | `2.3.1` | 双端抹平后的消息数据 |
| `type` | `string` | `1.2.6` | 消息类型 |
| `protocol` | `number` | `1.2.6` | 协议号 |
| `topic` | `string` | `2.5.1` | topic |


### 示例代码

#### 基础调用

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

const { offMqttMessageReceived } = device;

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