0

I am developing a React Native application. it's a framework to build mobile applications with JavaScript and deploy for Android & iOS with the same code base.

I read somewhere that RN applications are dynamically updated. It means, without releasing new versions to AppStore or GoogleStore, we can update it. It is awesome!

But my question is: how can we do so? I searched a bit and found out that it is possible with Codepush. If so, how? Is it a free tool or we should pay for it? If it's not free, Isn't there a free solution to this?

Also, by updating dynamically, are we limited to update only JS bundle or we are able to update external assets like new fonts, images, and etc?

I would be thankful if an expert guides me by details and workarounds.

Cheers.

Saeed
  • 47
  • 1
  • 10

2 Answers2

1

Like it explains in CodePush website;

CodePush is a cloud service that enables Cordova and React Native developers to deploy mobile app updates directly to their users’ devices. It works by acting as a central repository that developers can publish certain updates to (e.g. JS, HTML, CSS and image changes), and that apps can query for updates from (using our provided client SDKs). This allows you to have a more deterministic and direct engagement model with your end-users, while addressing bugs and/or adding small features that don’t require you to re-build a binary and/or re-distribute it through any public app stores.

This means you can update your Javascript code remotely without submitting your app through App Store or Google Play.

This service is currently completely free and you can use it in your app without paying any fees. There are also couple of more systems that are payed or free but I have never used them so I can't say anything about them.

This service does not let you change or update any of the native code so if you add any native code supported libraries or write one yourself or update any existing native libraries or codes, you need to publish the new version through the stores.

This types of services also help you to do A/B tests and alfa/beta tests.

You can find much more detailed information at CodePush website and Google.

bennygenel
  • 23,896
  • 6
  • 65
  • 78
  • If "This service does not let us change or update any of the native code", so what does this service do for us? What remains to update except of native code? – Saeed Sep 17 '17 at 16:30
  • Well, I didn't get you. Since the main idea of react native is to convert JS to native code at final steps. Could you be more specific? e.g what happens if I add a element to my code. Can I update the application through codepush? What about navigation & routing? – Saeed Sep 18 '17 at 05:49
  • You got it a little bit wrong. React-Native doesn't convert your code to Native languages. It bridges between native side and the javascript. This way you can trigger or run native code from javascript. If you have a Text component in your javascript code, react-native dynamically adds the appropriate native version of it to the view when the javascript code runs. So in theory you can change all the code in javascript. – bennygenel Sep 18 '17 at 08:08
  • Great, so as a summarize, is it possible to change element or navigation or add components and update RN application through codepush ? – Saeed Sep 18 '17 at 09:52
  • 1
    Yes. As long as the change doesn't involve any native code. For example, If you add [react-native-fbsdk](https://github.com/facebook/react-native-fbsdk) which requires addition and changes to the native code, you can't update your app with CodePush. But just changing a `` component to `` component or changing its style or any other manipulation to javascript code can be updated by codepush – bennygenel Sep 18 '17 at 09:59
0

Codepush is free and you can use react-native-code-push to use codepush service. You can use its document to have this service on your app.

Vahid Boreiri
  • 3,418
  • 1
  • 19
  • 34