能检测到有新版本,但没有成功、失败回调

发布于 5 年前作者 zhuyang14861 次浏览最后编辑 5 年前来自 ask
以前是可以正常收到回调,现在能检查到有新版本,但是不执行成功回调,也不执行失败回调。
手机型号:荣耀v30

const updateManager = wx.getUpdateManager()

updateManager.onCheckForUpdate(function (res) {
  // 请求完新版本信息的回调
  console.log(res.hasUpdate)
})

updateManager.onUpdateReady(function () {
  wx.showModal({
    title: '更新提示',
    content: '新版本已经准备好,是否重启应用?',
    success: function (res) {
      if (res.confirm) {
        // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
        updateManager.applyUpdate()
      }
    }
  })
})

updateManager.onUpdateFailed(function () {
  // 新版本下载失败
})
1 回复
oxue
oxue1 楼6 个月前

[Event] 21 listeners of event onBeforeUnloadPage_-1080511058 have been added, possibly causing memory leak.

报这个警告