小程序更新审批通过之后,其它客户端 并不执行更新是怎么回事?
更新代码如下:
if (wx.canIUse('getUpdateManager')) {
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function (res) { //当小程序向后台请求完新版本信息
if (res.hasUpdate) {
updateManager.onUpdateReady(function () { //当新版本下载完成,会回调这个事件
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function (res) {
if (res.confirm) {
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(function () { //当新版本下载失败,会回调这个事件
wx.showModal({
title: '程序版本更新通知',
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开'
})
})
}
})
} else {
wx.showModal({
title: '提示',
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
})
}
下一个版本上线后,才会执行这些代码
老版本小程序里面有没有这些代码?