mgtv.reportScene(Object object)
信息
框架版本 1.3.1 开始支持,其中框架版本通过 mgtv.getDeviceInfo() 返回对象的 frameworkVersion 字段获取。
上报场景事件。
参数
Object object
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
sceneId | number | 是 | 场景ID,【1000:启动完成 】 | |
success | function | 否 | 接口调用成功的回调函数 | |
fail | function | 否 | 接口调用失败的回调函数 | |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
object.fail 回调函数
参数
Object res
属性 | 类型 | 说明 |
---|---|---|
errMsg | string | 执行结果消息 |
errCode | string | 错误代码 |
示例代码
mgtv.reportScene({
sceneId: 1000,
success(res) {
console.log('场景事件上报成功', res)
},
fail(res) {
console.log('场景事件上报失败', res)
}
})