---
# System prepended metadata

title: What is CodePush in Rake Mobile?

---

# What is CodePush in Rake Mobile?

### Main concept
It's very similar to our web app. Native code is like a web browser - a container where we are running our javascript application.

When we need to set up some native features (for instance push notifications) we should modify native files (`AppDelegate.m`, `MainActivity.java` etc), build new app and update actually that "browser" through app stores.

But all stuff relates to the app's business logic, UI is actually our JS (javascript) application.

In our web application, we're loading our JS on each page reload. In the mobile app that JS is integrated into the build application and is static by default. We can't load new JS after the application built. That JS bundle is integrating into the app build and pushing into the store.

And here comes CodePush service. It adds the ability to "reload" our updated JS bundle just like we reload a web app in the browser. It will load integrated JS bundle as usual, then it can check for updates on CodePush service and if an update is present - it will download this update, replace the built-in one. Then on the next app launch, it will load that new JS bundle with updates included.

### What updates affect native files (`AppDelegate.m`, `MainActivity.java` etc)?
* Change application display name
* Change appearance of Splash screen
* React Native version update usually affecting a lot of native files (We doing it not very often)
* Any native library update (push notifications, navigation in the application, firebase stuff, pickers for files/images, share extension). I updating them quite rarely. In most cases that are plan updates (for add some fix in native library, or update deprecated one)
* Each major/minor (not patch) version update should be set in native files (for example 1.14.x -> 1.15.x)
* When changing [environment variables](https://gitlab.com/rake-developers/mobile-user-app/-/blob/develop/environments/prod/env.json) we should rebuild our app

### What updates affect JS bundle?
All other stuff like fixing the majority of bugs and adding features to app behaviour affecting only JS bundle:
* Any UI changes (component's appearance and placement)
* Any redux store changes
* API route changes (not including URL roots that defined in environment file)
* Not native libraries updates (chat, mentions, animations, dialogs, snack bars, localizations, UI components)

### How much time we need for the integration?
* Write docs with described versioning for regular/fast updates - 4h
* CodePush'fy iOS and Android platforms - 2h + 4h*
* Setup scripts for different update types - 4h
* Test the flow on deployed apps (TestFlight/Google Play) - 4h

TOTAL. About **2 days**

---
\* There are possible risks on that stage. The CodePush was gracefully integrated into clean and empty project. We should test how difficult the integration will be done on our "old" and big project.