About two years ago, a group of developers at Microsoft crafted a service for distributing Apache Cordova, React Native, and Windows Mobile updates to applications in the wild. They called it “CodePush.” Since then, mobile app developers have deployed thousands of releases to in-production apps – deploying quick bug fixes, feature improvements and content updates via the cloud. In a world where updates submitted through the app store can sometimes take days, these developers have enjoyed a huge market advantage because they can respond to customer feedback more quickly with instant app updates to some or all of their end-users.
On June 2nd, CodePush became part of Visual Studio Mobile Center, taking its place among other services designed and built for Mobile Developers. Let’s take a tour!
How does it work?
From a systems architecture standpoint, three different open source components make this possible: the SDK, CLI, and the Azure based service. The SDK is broken into platform specific implementations for Cordova and React Native. Developers use the CLI to release updates to the service which are then retrieved by the SDKs packaged with the customer’s app.
The CodePush Update Lifecycle
A typical CodePush update lifecycle works like this:
- Your customer installs your app from the store.
- If the cloud version is both higher and matches the native code version, then it downloads and installs the newer update.
Take it for a spin!
The best way to get to know any tool is to try it out; CodePush is no exception. For this example, we will use React Native. If you haven’t used React Native before: don’t worry it is absolutely painless to get started. This example assumes you’re already in the working directory of a simple “hello world” app.
After CodePush is installed into the application directory, all that is left to do is integrate the React Native SDK into the app; once this is done, you are ready to start using the CodePush CLI to make releases.
When releasing an update, you can choose from among a number of options. For example, you can release to only a subset of your users, force an update by making it mandatory or even revoke an update after its release. Although you can customize the user experience for any update, your app will display the following dialog by default when a new release is available:
Using the Mobile Center Dashboard
CLI tools separate functional concerns and make automation easy, but don’t succeed as well as rich GUIs when it comes to presenting information graphically and allowing for an easy flow between tasks.
CodePush is now integrated with Mobile Center’s dashboard to provide developers with a point-and-click interface for managing apps and deployments. To try it, create a React Native app in Mobile Center, hook it up to the sample app you created above, and check it out. Or watch us do it:
Currently we have a lot of plans for CodePush including but not limited to better integration with our crash service – which currently provides js stack traces for iOS – and bundle signing. In the coming months, we at Mobile Center will also be striving to provide further support for additional platforms both for CodePush and other services. Please check our blog and product roadmap for news and details but also let us know what you would like to see.
|Ian Geoghegan, Senior Program Manager, Mobile Developer Division
@mscodepushIan has been writing software for nearly twenty years across an assortment of domains. His interests include security, tools, and sustainable technology.