@lostintangent lostintangent released this Nov 27, 2015 · 1272 commits to master since this release

Assets 2

This is a significant release that contains many new features as well as some breaking changes. Please refer to the docs for more information regarding the behavior of the following API additions/modifications. You can update your react-native-code-push installation from NPM immediately to take advantage of these improvements.

New features (General)

  • Android support! This has been our #1 user request thus far, and so we're excited to get it out there. The Android API includes complete parity with iOS, including the new features mentioned in this release below.
  • The sync method now include a syncStatusChangedCallback parameter, which allows you to listen for state changes in the overall update process (e.g. update is available, download starting) and respond accordingly. This allows you to let the sync method handle the entire update process, while still having the option to display custom UI and/or perform additional behavior as needed.
  • The sync and RemotePackage.download methods now include a downloadProgressCallback parameter, which allows you to listen to progress events when an available update is being downloaded. This was a very common request and allows you to choose to show a download progress modal experience in your app.
  • The sync and LocalPackage.install method now accept an InstallMode parameter which allows you to determine whether the update should be installed immediately (the previous behavior), on the next app restart (to support fully silent installs) or on the next app resume.
  • The sync method now accepts an updateDialog parameter, which allows you to enable/disable the user confirmation, as well as customize its strings when displayed. The change, along with the InstallMode change above is what fully enables "silent updates" (see below for breaking changes with sync).
  • The sync and checkForUpdate methods now accept an optional deploymentKey parameter, which allows you to override the value that was specified in the Info.plist file (iOS) or MainActivity.java (Android). This enables you to build your app against a specific deployment (i.e. Production) and then dynamically "redirect" it at a different deployment
  • A new restartApp method was added to the react-native-code-push module, which allows your app to force a restart at any time. This can be useful when you choose not to install an available update immediately (e.g. when performing "silent" updates), but your app has a deterministic event that can be used to "force" the update instead of waiting for the user to restart/resume the app (e.g. when a form is submitted or a user navigates to the home route).
  • When your app is configured to used the packager for debugging, a CodePush update will no longer re-direct the React Native Bridge from the HTTP URL to the update file on disk. This change allows you to efficiently debug your app, as well as your CodePush update experience, without interrupting your flow as soon as an update is applied.

New features (iOS)

  • Besides the [CodePush bundleURL] method, which assumes your JS bundle is named main.jsbundle, the CodePush class now includes a bundleURLForResource: method (which lets you override the bundle name) and the bundleURLForResource:withExtension: method (which lets you override both the bundle name and extension).

Breaking changes (General)

  • This plugin now requires React Native v0.14.0 or greater. We needed to take advantage of some recent changes in the platform and choose to up our version requirement. If this is going to impact you, please let us know.
  • The sync method is now "silent" by default, and therefore, no longer displays the user prompt when an update is available, and also doesn't immediately restart the app after installing the update. This change was made based on lots of feedback. If you want to achieve the old behavior, you simply need to enable the updateDialog option and change the InstallMode to immediate when calling sync: codePush.sync({ userDialog: true, installMode: codePush.InstallMode.IMMEDIATE }).
  • The LocalPackage.apply method has been renamed to install to better reflect what it's actually doing.

Breaking changes (iOS)

  • The getBundleUrl method of the CodePush class has been renamed to bundleURL