- 为什么微信小程序体验版有的手机能收到websocket消息,有的收不到?
同样的websocket链接,都是wss的,证书和白名单都配置好了,发布体验版以后,有的能收到消息,有的收不到 [图片] [图片][图片]
2023-09-19 - uniapp怎样调用微信游戏初始化等api?
uni.getUserProfile({lang: 'zh_CN',desc: '获取你的昵称、头像、地区及性别', success: res => { uni.login({provider: 'weixin',success: function (rs) { let code=rs.code; console.log("登录获取的code=="+rs.code); let gameServerManager = wx.getGameServerManager(); gameServerManager.login({ code: code, success(res) { // 处理连接成功的逻辑 console.log('连接成功=='+JSON.stringify(res)); // 在连接成功后,可以继续使用其他游戏服务器接口 // 例如:创建房间、加入房间等操作 }, fail(f) { // 处理连接失败的逻辑 console.error('连接失败=='+JSON.stringify(f)); }, error(e){ console.error('连接错误=='+JSON.stringify(f)); } }); } }); }, fail: res => {console.log(2);console.log(res) //拒绝授权 uni.showToast({title: '您拒绝了请求,不能正常使用小程序',icon: 'error',duration: 2000}); return; } }); 这个代码上的游戏初始化api无论是wx还是uni,发布到微信开发者工具上都会报错,提示: WAServiceMainContext.js?t=wechat&s=1694088542629&v=3.0.1:1 TypeError: n.getGameServerManager is not a function at Object.success (index.js?t=wechat&s=1694088542629&v=c3fb1e1b4c6fd97326d8d3301a9424e9:1) at Function.I.forEach.v.<computed> (WAServiceMainContext.js?t=wechat&s=1694088542629&v=3.0.1:1) at :27560/appservice/<api login success callback function> at Object.success (WAServiceMainContext.js?t=wechat&s=1694088542629&v=3.0.1:1) at a (WAServiceMainContext.js?t=wechat&s=1694088542629&v=3.0.1:1) at Mu (WAServiceMainContext.js?t=wechat&s=1694088542629&v=3.0.1:1) at Nu (WAServiceMainContext.js?t=wechat&s=1694088542629&v=3.0.1:1) at WAServiceMainContext.js?t=wechat&s=1694088542629&v=3.0.1:1 at s (WAServiceMainContext.js?t=wechat&s=1694088542629&v=3.0.1:1) at VM16 asdebug.js:1(env: Windows,mp,1.06.2308291; lib: 3.0.1) 有办法解决吗,需要先配置game.json的话怎么配置啊
2023-09-07 - 今天微信小程序获取不了微信头像和昵称了,有人知道咋回事怎么解决吗?
[图片] [图片] [图片] [图片]
2023-03-24