Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

v1.7.0-beta

Compare
Choose a tag to compare
@lostintangent lostintangent released this 20 Apr 22:32
· 293 commits to master since this release

This release introduces a couple of highly-requested features, as well as some key bug fixes. It is now available on NPM and can be updated immediately by running cordova plugin add cordova-plugin-code-push@latest.

New Features

  1. Added support for throttling resume-based installs We've seen a lot of developers want to use the resume-based install strategy, in order to get their updates in front of their end users sooner. However, forcing a restart on the next resume might be too obtrusive if the user switched away from the app for only a few seconds (e.g. to respond to a text). In order to help get updates in front of users sooner, while still respecting their workflow, the sync method now accepts a new option called minimumBackgroundDuration that specifies the number of seconds that the app needs to have been in the background before forcing the install. More details

    // If the app was in the background for 10 minutes, we assume that it is "safe" to restart to install the update
    codePush.sync(null, { installMode: InstallMode.ON_NEXT_RESUME, minimumBackgroundDuration: 10 * 60 });
  2. Optional and mandatory updates can be now be installed using different strategies The sync method now accepts a new option called mandatoryInstallMode, which allows you to individually customize the install mode that is used for optional and mandatory updates. This new property defaults to InstallMode.IMMEDIATE (which is what we've found most devs want), but can be changed by passing a different value when calling sync.

    // Install optional updates on restart, but enforce mandatory updates on the next app resume
    codePush.sync(null, { mandatoryInstallMode: InstallMode.ON_NEXT_RESUME });
  3. The contents of the binary are now hashed and sent to the CodePush server so that we can detect whether an available update is equivalent to what the end-user is already running. This helps prevent the unnecessary first-run update issue, and we now encourage developers to release their binary contents to CodePush to help solve this scenario, as well as enable diff updates for the initial CodePush update after a fresh binary install/update.

Bug Fixes (General)

  1. The deploymentKey parameter of the checkForUpdate and sync methods can now be specified without needing to also configure a deployment key in the app's config.xml file. This way, you can configure your deployment keys entirely in code and/or at runtime.

Bug Fixes (Android)

  1. File permissions are now configured correctly for Marshmallow devices, which ensures that a consent dialog isn't displayed when a CodePush update is about to be written to disk. Please ensure that you have >= 4.2.0 of the cordova-plugin-file plugin installed to ensure this fix is included.