有版本更新,IOS的onCheckForUpdate返回一直为false,而安卓正常
发布于 4 年前 作者 li50 9226 次浏览 来自 官方Issues
// 检测是否可以调用getUpdateManager检查更新
    if (!wx.canIUse('getUpdateManager')) return;
    const me = this;
    this.updateManager = wx.getUpdateManager();
    this.updateManager.onCheckForUpdate(function (data) { // 请求完新版本信息的回调
      console.log('是否有新版本:' + data.hasUpdate);
      log.warn('是否有新版本:' + data.hasUpdate);
      if (data.hasUpdate) {
        wx.request({
          url: config.getWxVersion,
          success (res) {
            console.log('000000000', res.data);
            const minVer = Number(res.data.returnObject.split('-')[2]);
            const accountInfo = wx.getAccountInfoSync();
            const curVer = Number(accountInfo.miniProgram.version.split('-')[2]);
            // console.log('最小版本:' + minVer);
            // console.log('当前版本:' + curVer);
            log.warn('最小版本:' + minVer);
            log.warn('当前版本:' + curVer);
            if (curVer < minVer) {
              me.upDateVer();
            }
          }
        });
      }
    });
1 回复

ios有问题,安卓正常?和这个用户问题相同,机型不一样?https://developers.weixin.qq.com/community/develop/doc/000e487d8f45401c15dcf108556400

回到顶部