React Native + React-Redux + Native Base + Code Push
##Setting Up Project
-
npm i -g rninit
-
rninit init <new-app-name> --source react-native@0.34
, this is basically "react-native init" but you can specify a version of react-native -
git init
-
git add . && git commit -m "first commit"
-
git remote add starterpack https://github.com/iSimar/React-Native-Starter-Pack.git
-
git pull starterpack
-
git merge -s recursive -X theirs starterpack/master
-
Change
new_app_name
in index.ios.js (line 5), index.android.js (line 5) and package.json (line 2) file to<new-app-name>
-
npm install
-
code-push app add <new-app-name>
-
react-native link
, put the production code-push key from step 10 when prompted -
git add . && git commit -m "first production commit"
##Deploying Changes Through Code Push
-
Make your code changes
-
code-push release-react <new-app-name> ios --deploymentName Production
, release for ios -
code-push release-react <new-app-name> android --deploymentName Production
, release for android
Tip: if you messed up a release and want to rollback use code-push rollback <new-app-name> Production
code-push release-react command options:
code-push release-react <appName> <platform>
[--bundleName <bundleName>]
[--deploymentName <deploymentName>]
[--description <description>]
[--development <development>]
[--disabled <disabled>]
[--entryFile <entryFile>]
[--mandatory]
[--plistFile <plistFile>]
[--plistFilePrefix <plistFilePrefix>]
[--sourcemapOutput <sourcemapOutput>]
[--targetBinaryVersion <targetBinaryVersion>]
[--rollout <rolloutPercentage>]
- You can view your current deployment stats using
code-push deployment history <new-app-name> Production
##Store Releases
If you want to release a new update of your app through the play store or app store, do the following:
-
Make your code changes.
-
Increment app version number in
ios/<new-app-name>/Info.plist
(CFBundleShortVersionString & CFBundleVersion) andandroid/app/build.gradle
(versionCode & versionName) -
Build and submit your app to the store