# subscribeMessage ^6.8
订阅/取消订阅 设备状态的推送注:1.请求成功后,发起订阅的页面能收到推送,其他页面不能收到推送。2.此接口功能是订阅推送,推送内容的接收通过receiveMessage接口。
# 请求参数
Prop | Type | Default | Comment |
---|---|---|---|
deviceId | Array | N/A | 想订阅的设备id, 空数组表示清空订阅设备 |
# 接口调用示例
const params = {
deviceId: 'xxx'
}
this.$bridge
.subscribeMessage(params)
.then(res => {
this.$alert(res)
})
.catch(err => {
this.$toast(err)
})
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
# 返回参数
- 成功时返回
Prop | Type | Default | Description |
---|---|---|---|
errorCode | String | N/A | |
errorMessage | String | N/A |
- 失败时返回