Skip to main content

Quick Start Guide

This guide will help you get started with Source Push in your React Native application.

Prerequisites

Before you begin, ensure you have:

  • A React Native application
  • Node.js installed (version 18.0 or higher)
  • npm or yarn package manager
  • Basic knowledge of React Native development

Installation Steps

1. Install the Source Push CLI

See the CLI Installation guide for instructions.

2. Create a Source Push Account

Visit Source Push Console to create your account.

3. Log in to Source Push CLI

srcpush login

4. Add Your Application

Create an app for each platform:

srcpush app add MyApp-iOS
srcpush app add MyApp-Android

5. Install the React Native SDK

Follow the React Native SDK Setup to add the SDK to your project.

The linking process varies depending on your React Native version and platform:

For iOS (via CocoaPods)

  1. Add the following to your ios/Podfile:

    pod 'CodePush', :path => '../node_modules/@srcpush/react-native-code-push'
  2. Run pod install:

    cd ios && pod install

For Android

  1. Update android/settings.gradle
  2. Update android/app/build.gradle
  3. Update MainApplication.java

Refer to the detailed Android setup guide for specific changes.

7. Configure Your App

Wrap your root component with the CodePush HOC:

import codePush from "@srcpush/react-native-code-push";

const App = () => {
return (
<View>
<Text>Your App Content</Text>
</View>
);
};

export default codePush(App);

8. Deploy Your First Update

Make changes to your JavaScript code, then deploy:

srcpush release-react MyApp-iOS ios
srcpush release-react MyApp-Android android

Next Steps