CodePush is a magical service that lets you update your app on the fly! It means that when you find a bug in your app you can push the code instantly to your users and update their apps / release new features.
Why should I care?
With Native apps you have to go through app review process every time you release a new version. Sometimes its fast, sometimes its not. But with CodePush you can update JS part of the app bypassing the review!
Me wants!
Setup is actually quite easy and documentation pretty good. You need to:
- Install CLI tools
- Register your app
- Install CodePush in your app
npm install --save react-native-code-push react-native link react-native-code-push
- Wrap your top-level component in a codepush wrapper
import codePush from "react-native-code-push"; class TeamParrot extends Component { ... } export default codePush( TeamParrot );
- Add deployment keys to your project
- iOS: add to info.plist:
CodePushDeploymentKey your key
- iOS: add to info.plist:
- To update and rollback your app:
code-push release-react TeamParrot-ios ios code-push promote TeamParrot-ios Staging Production code-push rollback TeamParrot-ios Production
- Profit
React Native Isomorphic app over the weekend
This article is part of my “React Native Isomorphic app over the weekend” series. It shares the problems I encountered during development of TeamParrot and Headstart Journal.
[display-posts tag=”React-Native-Weekend” wrapper=”ul”]
As easy as that?! 🙂