This repository was archived by the owner on May 20, 2025. It is now read-only.
v1.3.0-beta
·
1522 commits
to master
since this release
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 asyncStatusChangedCallback
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 thesync
method handle the entire update process, while still having the option to display custom UI and/or perform additional behavior as needed. - The
sync
andRemotePackage.download
methods now include adownloadProgressCallback
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
andLocalPackage.install
method now accept anInstallMode
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 anupdateDialog
parameter, which allows you to enable/disable the user confirmation, as well as customize its strings when displayed. The change, along with theInstallMode
change above is what fully enables "silent updates" (see below for breaking changes withsync
). - The
sync
andcheckForUpdate
methods now accept an optionaldeploymentKey
parameter, which allows you to override the value that was specified in theInfo.plist
file (iOS) orMainActivity.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 thereact-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 namedmain.jsbundle
, theCodePush
class now includes abundleURLForResource:
method (which lets you override the bundle name) and thebundleURLForResource: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 theupdateDialog
option and change theInstallMode
to immediate when calling sync:codePush.sync({ userDialog: true, installMode: codePush.InstallMode.IMMEDIATE })
. - The
LocalPackage.apply
method has been renamed toinstall
to better reflect what it's actually doing.
Breaking changes (iOS)
- The
getBundleUrl
method of theCodePush
class has been renamed tobundleURL