小程序版本更新updateManage接口触发不了?我放在onLaunch里,有时能触发。
发布于 7 年前 作者 kwen 2934 次浏览 来自 官方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 回复

有更新时才提示

回到顶部