React Native CodePush Cheat Sheet
Getting Started
npm install -g code-push-clicode-push registercode push app add MyApp-Android android react-nativeIn React-Native app
yarn add react-native-code-push@latestreact-native link react-native-code-pushreact-native run-android --variant=releaseStaging(Need to configure releaseStaging in build.gradle)
Updating Apps
Retrieve list of your apps
code-push app lsRetrieve keys for app
code-push deployment ls MyApp-Android -kRelease an update to Staging
code-push release-react MyApp-Android androidPromote an update to Production
code-push promote MyApp-Android Staging ProductionCheck Deployment History
code-push deployment history MyApp-Android StagingJavaScript Integration
import React, { Component } from 'react'
import CodePush from 'react-native-code-push'
class MyApp extends Component { }
const codePushOptions = {
checkFrequency: codePush.CheckFrequency.ON_APP_RESUME,
installMode: codePush.InstallMode.ON_NEXT_RESUME
}
export default codePush(codePushOptions)(MyApp);