After updating WeChat Mini Programs's code, the person who opened it before on Wechat opened it or the original version?

how do I check whether it is the latest version every time I open it?

Feb.28,2021

selecting a full update when releasing the code seems to automatically update the client's app code.

use Wechat API:wx.getUpdateManager ()

const updateManager = wx.getUpdateManager()

updateManager.onCheckForUpdate(function (res) {
  // 
  console.log(res.hasUpdate)
})

updateManager.onUpdateReady(function () {
  wx.showModal({
    title: '',
    content: '',
    success: function (res) {
      if (res.confirm) {
        //  applyUpdate 
        updateManager.applyUpdate()
      }
    }
  })

})

updateManager.onUpdateFailed(function () {
  // 
})

for more information, please see Wechat's running logic: https://developers.weixin.qq.

.
Menu