问题点:
为什么?为什么呢?按照官方示例调用wx.getUpdateManager() 更新提示接口,小程序版本更新提示本地测试能提示,但是上线始终就不行
appid: wx48b2ead80e63d9f1
官方API:小程序更新机制
https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/update-mechanism.html
参考社区方案没用:wx.getUpdateManager() 为什么检测不到小程序版本更新?
代码片段:
onShow: function() {
console.log("App Show");
// 获取小程序配置
this.$store.dispatch('fetchMiniAppConfig')
// 检查小程序版本更新
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function(res) {
console.log(res.hasUpdate);
});
updateManager.onUpdateReady(function(res) {
uni.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success(res) {
if (res.confirm) {
updateManager.applyUpdate();
}
}
});
});
updateManager.onUpdateFailed(function(res) {
uni.showModal({
title: '更新提示',
content: '新版本下载失败,请检查网络后重试。',
showCancel: false
});
});
}
@腾讯官方
