开发工具模拟版本更新正常,但是真机去触发版本更新就有问题。
真机每次都要点击右上角的重新进入小程序,才会触发
微信小程序版本更新问题?Is there a problem with the WeChat applet version update?
微信小程序版本更新问题?开发工具模拟版本更新正常,但是真机去触发版本更新就有问题。
真机每次都要点击右上角的重新进入小程序,才会触发
The development tool simulation version update is normal, but there is a problem when the real machine triggers the version update. Real machine every time to click on the top right corner to re-enter the small program, will trigger
回答:
在app.js中的onLaunch添加事件
const updateManager = wx.getUpdateManager();
wx.getUpdateManager().onUpdateReady(function() {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function(res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
}
})
})
谢邀
搞个代码片段看下
是不是跟小程序的冷热启动
原文出处:微信小程序版本更新问题?
手机: 华为Noav5Pro
微信版本: 8.0.2