DeployPulse

React Native SDK

DeployPulse uses the CodePush SDK to deliver OTA updates to your React Native app. Install the package, follow the setup guide for your platform, then wrap your root component.

Install

npm install @deploypulseio/react-native-code-push

Choose your setup

Usage

Wrap your root component with the codePush HOC:

import codePush from '@deploypulseio/react-native-code-push';

const App = () => <View>...</View>;
export default codePush(App);

With options:

export default codePush({
  checkFrequency: codePush.CheckFrequency.ON_APP_RESUME,
  installMode: codePush.InstallMode.ON_NEXT_RESTART,
})(App);

Manual sync (e.g. button press):

export default codePush({ checkFrequency: codePush.CheckFrequency.MANUAL })(App);

// elsewhere
codePush.sync({ updateDialog: true, installMode: codePush.InstallMode.IMMEDIATE });

Notify App Ready

After an update is applied and the app launches successfully, call notifyAppReady():

import codePush from '@deploypulseio/react-native-code-push';
import { useEffect } from 'react';

function App() {
  useEffect(() => { codePush.notifyAppReady(); }, []);
}

Without this call, CodePush treats the update as failed and automatically rolls back after a configurable number of launches. This is also required for Auto Rollback error-rate detection to work correctly.

Further reading