版本更新updateManager开发模拟和安卓上都可以,在ios真机上无效

onLaunch (options) {
const updateManager = my.getUpdateManager();
    updateManager.onCheckForUpdate(function (res) {
      console.log('123456', res);
      // 检查更新结果
      console.log(res.hasUpdate);
    });
    updateManager.onUpdateReady(function () {
      my.confirm({
        title: "更新提示",
        content: "新版本已经准备好,是否重启应用?",
        success: function (res) {
          if (res.confirm) {
            // 新版本已经下载好,调用 applyUpdate 应用新版本并重启
            updateManager.applyUpdate();
          }
        },
      });
    });
    updateManager.onUpdateFailed(function () {
      // 新版本下载失败
    });
}
console.log('123456', res);在ios真机调试没有触

版权声明:本文为gxdzi原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。