receiveMessageFromApp 订阅app发布的数据

receiveMessageFromApp

此监听Key用于接收APP(包括第三方SDK)主动调用Weex页面,当APP主动调用时时,触发此监听

#请求参数

  • N/A

#接口调用示例

    const globalEvent = weex.requireModule('globalEvent')
     
    export default {
    .....   
    created() {
        globalEvent.addEventListener('receiveMessageFromApp', (data) => {
            // 业务逻辑
            .....
            if (data.messageType == 'xxxx'){
                console.log(data.messageBody)
            }
        })
    }
    .....
    }

#返回参数

Prop Type Default Description
messageType String N/A H5用来判断消息类型,然后做相对应的处理
messageBody Object N/A APP传递的JSON对象
  • 注1:messageType / messageBody参数列表
messageType messageBody Description
applicationWillResignActive N/A ios APP进入后台(只有调用了this.$bridge.setBackHandle("on")才会触发此通知)
hardwareBackClick {} 属性: onlineStatus: 安卓物理返回键进入后台(只有调用了this.$bridge.setBackHandle("on")才会触发此通知)
queryStatusFromApp {} App端主动通知weex端重新查询状态(在从控制页反回卡片页时,有些设备状态没同步过来,需要重新查询一次)
deviceOnlineStatus {} 属性: onlineStatus: 设备上报在线离线状态
networkStatusChanged {} 属性: status: type: 网络状态变化监控
aiSpeechNotification {} 属性: key: raw:, Description: 思必驰原始返回结果对象,其中raw.conf为可信任度,范围0~1的浮点数,数值越高越可信 } 思必驰语音识别反馈
aiSpeechAcyionResult {} 思必驰语音执行结果反馈
aiSpeechAcyionResult {} 属性: key: raw:, Description: 思必驰原始返回结果对象,其中raw.conf为可信任度,范围0~1的浮点数,数值越高越可信 } 思必驰语音识别过程反馈
sleepPush {} 属性: sceneId: homegroupId: 早睡习惯推送通知
sleepPushCancel {} 早睡习惯推送忽略按钮点击通知
bluetooth {isBluetoothControl: '1'} // '1'支持,'0'不支持 设备是否支持蓝牙控制 ^8.9
pushTSLNotificationForwarding {} 属性: data:, Description: 物模型推送通知消息体 } 物模型推送通知

#返回示例

  • N/A

tip

deviceId字段在套系的数据上报时才有的返回字段,普通的数据上报没有该字段

posted on 2024-12-18 09:22  AtlasLapetos  阅读(26)  评论(0)    收藏  举报