wx.reportGameEvent()
本接口仅适用于小游戏试玩,非小游戏标准接口
功能描述
上报试玩自定义数据
参数
Object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
| eventId | Number | | 是 | 自定义事件ID,建议总数控制在 50 个内 |
| costTime | Number | 0 | 否 | 事件耗时,单位 ms |
| result | Number | 1 | 否 | 事件结果:1-成功;2-失败 |
| success | function | | 否 | 接口调用成功的回调函数 |
| fail | function | | 否 | 接口调用失败的回调函数 |
| complete | function | | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
object.fail 回调函数
参数
Object err
| 属性 | 类型 | 说明 |
| errMsg | String | 错误信息 |
错误
| 错误码 | 错误信息 | 说明 |
| eventId is not a number | 传入的eventId不是number |
| result is not valid | 传入的result不是 1、2 |
示例代码
The translations are provided by WeChat Translation and are for reference only. In case of any inconsistency and discrepancy between the Chinese version and the English version, the Chinese version shall prevail.Incorrect translation. Tap to report.