ios微信小游戏切后台后回来websocket发不出消息,报错?

小游戏 企业微信 微信支付 小程序 文章 2020-07-30 21:01 1087 0 全屏看文

AI助手支持GPT4.0

ios微信小游戏切后台后回来websocket发不出消息,报错?

Uncaught (in promise) FrameworkError   Object { errMsg: "closeSocket:fail taskID not exist" } e@https:/es.servicewechat.com/weapp/debug/***************/1/:27576:36669 value@https:/es.servicewechat.com/weapp/debug/***************/1/:27576:32222 https:/es.servicewechat.com/weapp/debug/***************/1/:27576:16387 https:/es.servicewechat.com/weapp/debug/***************/1/:27576:19197 forEach@[native code] https:/es.servicewechat.com/weapp/debug/***************/1/:27576:19087

Uncaught (in promise) FrameworkError Object {errMsg: "cl oseSocket:fail taskID not exist e http:// res.servicewechat.com/weapp/debug/ *****************1/:27576:36669 value http:// res.servicewechat.com/weapp/debug/ *****************1/:27576:32222 http://www.google.com/sea....tin-round+rock+texas *****************1/:27576:16387 http://www.google.com/sea....tin-round+rock+texas *********************/1/:27576:19197 forEach@native code] http://www.google.com/sea....tin-round+rock+texas *****************1/:27576:19087

回答:

Forever:

我使用官方的小游戏API调用示例(https://github.com/wechat-miniprogram/minigame-demo),没有复现你的报错,但是websocket连接后如果切入后台一段时间是会自动断开,在切回来后需要你手动重连。我测试的机子是iPhone11

慢慢🐣:我这边开发者工具ok  手机上安卓和ios都出现这个问题  是怎么回事  https://developers.weixin.qq.com/community/minigame/doc/0004e2da040918b225aa8223457000
Forever:那就证明开发者工具有bug,我向相关人员反馈一下
慢慢🐣:查出问题了  是因为cocos生成的project.js超过了500kb
慢慢🐣:这里的警告信息 不注意看 还真不知道多了一个文件

-EOF-

AI助手支持GPT4.0