小程序版本更新updateManage接口触发不了?我放在onLaunch里,有时能触发。

发布于 8 年前作者 kwen3133 次浏览最后编辑 8 年前来自 issues

const updateManager = wx.getUpdateManager(); // 获取更新管理器对象

updateManager.onCheckForUpdate(function (res) {

console.log(res)

if (res.hasUpdate) {

updateManager.onUpdateReady(function () {

wx.showModal({

title: '更新提示',

content: '新版本已经准备好,点击确定重新启动',

showCancel: false,

success: res => {

if (res.confirm) {

updateManager.applyUpdate();

}

}

})

})

})

})

1 回复
jie58
jie581 楼6 年前

有更新时才提示