大量用户停留在旧的版本未升级
发布于 5 年前 作者 wei50 5083 次浏览 来自 问答

通过我们的日志收集,发现最近几天新来的用户全都使用的是旧版本小程序,用户为什么不是使用的我们的最新版本小程序呢

我们最新的小程序版本是94

最近几天有一部分新用户安装的都是61

3 回复

如果需要马上应用最新版本,可以使用 wx.getUpdateManager API 进行处理。

如果不写强制更新代码,用户也应该会在24小时以后自动下载包到新版本吧?我们还是很多用户停在旧版本,都过去4天了

/**
 * 更新
 */
export function taroUpdate () {
  const updateManager = Taro.getUpdateManager()
  updateManager.onCheckForUpdate((res) => {
    // 请求完新版本信息的回调
    if (res.hasUpdate) {
      updateManager.onUpdateReady(() => {
        Taro.showModal({
          title: '更新提示',
          content: '新版本已经准备好,是否重启应用?',
          success: (res) => {
            if (res.confirm) {
              // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
              updateManager.applyUpdate()
            }
          },
        })
      })
      updateManager.onUpdateFailed(() => {
        // 新的版本下载失败
        Taro.showModal({
          title: '已经有新版本了哟~',
          content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~',
        })
      })
    }
  })
}

小程序启动强制更新下,这个是taro版本的

回到顶部