Code Monkey home page Code Monkey logo

code-push-cordova-demo-app's People

Contributors

lisong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

code-push-cordova-demo-app's Issues

IOS平台真机下回滚信息提示

在模拟器下测试更新一切都正常,

但是下载到真机之后,发现第一次打开时安装更新进度条可以正常读取100%,之后页面并没有内容替换,然后后台结束应用,第二次打开之后仍然提示更新提示框,但是此时点击安装,进度条不在变化,始终是0;

使用safari调试工具查看控制台信息如下:

问题依然是回滚,很奇葩,请指教,谢谢~

image

版本回滚问题

捕获报错:
An update is available, but it is being ignored due to have been previously rolled back.

现象描述:
每次重启应用都会提示要更新,当安装更新之后调用codePush.restartApplication(), 无限弹出更新提示框, 一直循环更新。

主要代码如下:

    // 检查是否有新的更新
    checkSyncImmediate() {
      codePush.checkForUpdate((update) => {
        console.log('-------' + update)
        // 如果有更新,则弹出更新提示框, 提示用户进行更新app操作
        if (update) {
          this.modalVisible = true
          let updateDescription = update.description
          if (updateDescription) {
            this.updateInfoList = updateDescription.split(',')
          }
          // 是否强制更新,暂时未处理
          this.isMandatory = update.isMandatory
        }
      })
    },

    // 立即更新
    _immediateUpdate() {
      this.immediateUpdate = true
      // 开始同步热更新app
      codePush.sync(
        this.codePushStatusDidChange,
        {
          updateDialog: false,
          installMode: InstallMode.IMMEDIATE,
          mandatoryInstallMode: InstallMode.IMMEDIATE
        },
        this.downloadProgress
      )
    },

    // 下载进度
    downloadProgress(downloadProgress) {
      if (this.immediateUpdate && downloadProgress) {
        let currProgress = parseFloat(downloadProgress.receivedBytes / downloadProgress.totalBytes).toFixed(2)
        if(currProgress >= 1) {
          // 更新部分下载完成后,重启应用
          codePush.restartApplication()
          this.modalVisible = false
        } else {
          // 进度条赋值
          this.currentPercentage = Math.ceil(currProgress * 100)
        }
      }
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.