Code Push for React Native

What Is Code Push ?

Michael Chung
3 min readMay 9, 2016

Code Push allows you to update the javascript bundle and images (limited to specific components) in your RN-App. Allowing your app to update without deploying to the App Code Push allows you to change the UI/UX, business logic fix bugs, load hot-fixes.

What Code are we Pushing ?

A React Native App is composed of Javascript files and images and native code from the bridged sections and in the view layer.

These are bundled together with the packager ios/android.bundle.js + images + native code into an IPA or an APK file.

Code Push allows you to update the ios/android.bundle.js and images, without going through the whole app store process (partial continuous delivery), which in theory should be the bulk of your application is going to be mostly javascript 70–90%.

What are Code Push the Limitations ?

Any code touching the native side of react native i.e AppDelegate.m/MainActivity.java cannot be distributed via code push. It requires an App store update.Code that bridges functionality back to native cannot be included in the update mainly because of the Supported by iOS 8+ and Android 4.1+, to get the best milage use the latest version of react native. At the time of this writing React-Native 0.25.

Dependencies ?

This is a service that is run by Microsoft, and the service may include service fees in the future. There is a few open sourced tools released by Microsoft for automating the CLI, and the react-native plugin module itself, allowing you to add your own components to the images update.

Supported Components ?

Code push only supports a few components for image swapping in it’s current release.

It will right now only support core components and will update code push as they are released. You can modify the plugin to your liking.

Rollback support ?

Code push maintains an prior version of your update just encase you push an update that results in a crash. That way you can perform a roll back on the server. More here.

Team Support ?

In the documentation there is a wealth of information about how to add other team members to code push access.

How does this integrate with iOS/Android Apps ?

For Android and iOS there you will need a client library that installs into the native codebase, from there on there are pre-established native api calls that can be set to determine when the code should be pulled to the client. You can pull the code based on a timer, or on every relaunch, it is really up to you to decide when the code will be pulled to the devices, you setup the policy.

How can I get Started ?

This is a comprehensive tutorial on how to setup code push. Code push does not currently have a front end most of the work will be done from terminal.

--

--