收藏
回答

这个api在Cocos怎么使用wx.reportGameEvent?

try {
   wx.reportGameEvent({
   eventId: eventId,
   costTime: costTime,
   success: () => { console.log(`[埋点] ✔成功 eventId:${eventId} costTime:${costTime}`); },
   fail: (res: any) => { console.error(`[埋点] ❌失败 eventId:${eventId} 原因:${res.errMsg}`); }
    });
} catch (error) {
console.warn(error);
}

为什么最后在试玩环境下还是出现了TypeError: wx.reportGameEvent is not a function错误,

回答关注问题邀请回答
收藏

1 个回答

  • 智能回答 智能回答 本次回答由AI生成
    2025-12-31
    有用
登录 后发表内容