Skip to content

Releases: microsoft/react-native-code-push

v1.4.0-beta

05 Dec 02:24
Compare
Choose a tag to compare

This release introduces support for updating images via CodePush using the new React Native assets system. It currently only works for iOS, but we're working on Android support. In the meantime, you can still use CodePush and the new assets system on Android, and nothing will break, you just won't be able to add/edit images via CodePush like you can with iOS.

In order to support this change, we needed to rely on v0.15.0 of React Native, so if you're still using v0.14.*, we recommend sticking with v1.3.0 of CodePush. That said, we think the new asset system is awesome, and is way worth upgrading, so we encourage you to do it :)

Additionally, once you are using the assets system, you are no longer simply releasing updates of your JS bundle file, and therefore, you'll need to change your CodePush workflow a little bit. Refer to the docs for all the details here. We promise that it's still simple!

Note: If you aren't using the new React Native assets system, then you can continue to release only your JS bundle to CodePush, and rely on your images to be loaded from the binary. CodePush won't break this workflow in any way.

Breaking Changes (General)

  1. As mentioned above, this version of CodePush requires v0.15.0 of React Native. Even if you're not using the assets system or you are but on Android, this release of the CodePush plugin requires you to upgrade your RN dependency.

Breaking Changes (iOS)

  1. This upgrade requires an additional setup step for iOS to link the libz library with your app (we use it to unzip updates which contain the JS bundle and images). Refer to step #5 in the iOS installation section of the docs to see how to do this. If you upgrade your plugin and see a bunch of weird errors, this is likely the reason.
  2. If your app was already using the new assets system and deployed updates to CodePush that only specified a JS bundle, you need to do another release via the CLI which includes your assets and bundle (details here). When the plugin installs an update that contains only a JS bundle, it assumes you aren't using the React Native assets system, and therefore, won't copy over your existing assets in the binary to the location that the update is written to (and your app layout will be broken). As mentioned above, if you aren't using the new assets system, you can keep releasing just the JS bundle, and your release workflow doesn't need to change.

v1.3.1-beta

29 Nov 06:14
Compare
Choose a tag to compare

This is a bug fix release that ensures the actual update download runs on a background thread (Android only), and fixes a regression with the mandatory update message displayed as part of the sync method. Thanks to @oney for these contributions!

v1.3.0-beta

27 Nov 20:14
Compare
Choose a tag to compare

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

v1.1.2-beta

08 Nov 20:19
Compare
Choose a tag to compare

This is a bug fix update, which addresses the following issues:

  1. #41 - Updates are now appropriately being "ignored" when they are associated with an app store version other than the one which the end-user is currently running. This was always the intended behavior, but it was regressed with a feature release. Therefore, if the end-user is running v1.0.0 of your app, and the app queries CodePush for an update, it will only accepts updates that have been explicitly "tagged" as v1.0.0. Older versions were already ignored (for obvious reasons), and with this update, so are newer versions (e.g. v1.0.1), since it isn't clear that they would work with the end-users running version of the app binary.
  2. #38 - If the JS bundle in the app binary is newer then the JS bundle from the latest CodePush update, it will be used instead of simply always using the CodePush update when one is available. This behavior is necessary so that if an end-user updates the app from the store (or whatever other means they could acquire a newer IPA file), the contents of that update will take precedent as long as it's newer. Thanks @qingfeng for handling this PR!

This release has been published to NPM and is the recommended version for all developers.