DEV Community

Cover image for πŸš€ How to Enable Over-the-Air (OTA) Updates in React Native Using Stallion
Amit Kumar
Amit Kumar

Posted on β€’ Edited on

4 2 2 3 3

πŸš€ How to Enable Over-the-Air (OTA) Updates in React Native Using Stallion

Keeping your app users up-to-date instantly is easier than ever with Stallion β€” a powerful tool for Over-the-Air (OTA) updates in React Native. Forget waiting for app store approvals; push updates directly to your users with zero friction. πŸ™Œ

This guide walks you through setting up Stallion and publishing your first OTA update.


πŸš€ Why Use Stallion?

βœ… Built-in Testing Framework to validate updates before production
πŸ” Switch Between App Versions without rebuilding native code
πŸ“¦ Publish Bundles Instantly using Stallion CLI
πŸ“² Apply Updates In-App using the Stallion SDK
πŸ”„ Manual + Automatic Rollbacks with real-time rollback insights
πŸ“Š Detailed Analytics for update adoption and performance tracking
🏷️ Extensive Free Plan for indie devs and small teams
βœ… Production-Ready and trusted by teams shipping millions of updates


πŸ”§ Step 1: Set Up Your Stallion Account

To get started with Stallion, you'll first need to create a free account and set up your project.

βœ… Create Your Stallion Account

  1. πŸ‘‰ Go to the Stallion Dashboard
  2. Sign up or log in to your account.

🧱 Create a New Project
Once you're signed in, you'll be guided through the process of creating your first project.

Dashboard View
You'll land on the dashboard after logging in:

Image description


Click β€œCreate Project”
Hit the "Create Project" button to get started:

Image description


Fill in Your Project Details
Enter your project name and description, then click "Create":

Image description


Project Successfully Created
You'll now see your new project listed in the dashboard, Now Click on the project card to proceed.

Image description


πŸ—‚οΈ Create a New Bucket
Now, let’s set up a storage bucket for your project.

Bucket View – Click "Create Bucket"
Navigate to the Buckets section and click on "Create Bucket":

Image description


Create New Bucket
Fill in the necessary details to create your new bucket:

Image description

You're now ready to start integrating your application with Stallion! πŸŽ‰


πŸ“¦ Step 2: Install the Stallion CLI

Install the CLI to interact with Stallion from your terminal.

# Using npm
npm install --save-dev stallion-cli

# Or using Yarn
yarn add -D stallion-cli

Enter fullscreen mode Exit fullscreen mode

πŸ“² Step 3: Install the Stallion SDK

Add the Stallion SDK to your React Native project:

# Using npm
npm install react-native-stallion

# Or using Yarn
yarn add react-native-stallion

Enter fullscreen mode Exit fullscreen mode

Then, install CocoaPods for iOS:

npx pod-install

Enter fullscreen mode Exit fullscreen mode

🧩 Step 4: Configure Native Projects

πŸ€– Android Configuration

ℹ️ For React Native < 0.76

In MainApplication.java, update getJSBundleFile:

// ...other imports
import com.stallion.Stallion;

public class MainApplication extends Application implements ReactApplication {
  // ...rest of the class
  @Override
  protected String getJSBundleFile() {
      return Stallion.getJSBundleFile(getApplicationContext());
  }
}


Enter fullscreen mode Exit fullscreen mode

ℹ️ For React Native > 0.76

In MainApplication.kt, update the reactNativeHost:

// ...other imports
import com.stallion.Stallion

// ...other functions
override val reactNativeHost: ReactNativeHost =
  object : DefaultReactNativeHost(this) {
    override fun getPackages(): List<ReactPackage> =
      //other methods...

      override fun getJSBundleFile(): String? {
          return Stallion.getJSBundleFile(applicationContext)
      }
  }


Enter fullscreen mode Exit fullscreen mode

🍎 iOS Configuration

ℹ️ For React Native < 0.76

In AppDelegate.mm, update the sourceURLForBridge method:

// ...other imports
#import "StallionModule.h"

@implementation AppDelegate
// ...other implemetations
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
    #if DEBUG
      return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
    #else
      return [StallionModule getBundleURL];
    #endif
}


Enter fullscreen mode Exit fullscreen mode

ℹ️ For React Native > 0.76

In AppDelegate.swift, update the bundleURL() method:

// ...other imports
import react_native_stallion

// ...other functions
override func bundleURL() -> URL? {
    #if DEBUG
        RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
    #else
        StallionModule.getBundleURL()
    #endif
}


Enter fullscreen mode Exit fullscreen mode

πŸ” Step 5: Add Project ID and App Token

Add your Stallion credentials to platform-specific config files.

iOS (Info.plist):

Add below code on Info.plist file

<key>StallionProjectId</key>
<string>your_project_id</string>
<key>StallionAppToken</key>
<string>your_app_token</string>

Enter fullscreen mode Exit fullscreen mode

Android (res/values/strings.xml):

Add below code on strings.xml file

<string name="StallionProjectId">your_project_id</string>
<string name="StallionAppToken">your_app_token</string>

Enter fullscreen mode Exit fullscreen mode

You can generate your app token in the Stallion dashboard:

Click on Generate App Token button in order to get app token


Image description


πŸ” Find your Project ID and App Token under Project Settings in the Stallion Dashboard.


Image description


🧡 Step 6: Wrap Your App Component

In your App.js or App.tsx, wrap your root component with the withStallion HOC:

import { withStallion } from 'react-native-stallion';
// rest of your code
export default withStallion(App);

Enter fullscreen mode Exit fullscreen mode

πŸ“¦ Step 7: Create a Release Build

Android:

# macOS
./gradlew assembleRelease

# Windows
gradlew.bat assembleRelease

Enter fullscreen mode Exit fullscreen mode

iOS:

Use Xcode to archive and export a release build (IPA).

Install the build on a device or emulator to test.


πŸ§ͺ Step 8: Make a Code Change

Modify your app’s logic or UIβ€”for example, update some textβ€”and save your changes.


🚚 Step 9: Publish the OTA Update

1. Login to Stallion CLI:

npx stallion login

Enter fullscreen mode Exit fullscreen mode

This will open a browser window for authentication. Once logged in, copy and paste the token back into your terminal.

2. Publish the update:
Use the appropriate command below to publish your update for Android or iOS.

πŸ€– Android Command

npx stallion publish-bundle \
  --upload-path=orgname/project-name/bucket-name \
  --platform=android

Enter fullscreen mode Exit fullscreen mode

🍎 iOS Command

npx stallion publish-bundle \
  --upload-path=orgname/project-name/bucket-name \
  --platform=ios

Enter fullscreen mode Exit fullscreen mode

πŸ” Replace orgname, project-name, and bucket-name with your actual values.

Or use "Copy Bundle Path" from the dashboard in order to get the orgname/project-name/bucket-name:
Image description


πŸ“€ Step 10: Promote and Release the Bundle

Follow these steps to promote your Android (and iOS) bundle from staging to production.


βœ… Step 1: Access the Bundle Details

  • Navigate to the Stallion Dashboard
  • Click on the View Details button.

Image description


βœ… Step 2: Open the Android Bundles Tab

  • Click on the Android Bundles tab in the navigation bar.

Image description


βœ… Step 3: Add Release Notes and Promote

  • After clicking, a new box will appear.
  • Enter your release notes.
  • Click on Promote Bundle.

Image description


βœ… Step 4: Select Target Version & Finalize Promotion

  • In the Promote Bundle View, choose the target version.
  • Add the release notes again.
  • Click on Promote.

Image description


βœ… Step 5: Manage the Release

  • Once promoted, click on the Manage Release button.

Image description


βœ… Step 6: Publish to Production

  • Add the release notes.
  • Set rollout percentage to 100%.
  • Click on Publish Changes.

Image description

🍎 The same steps should be followed for iOS as well.


πŸŽ‰ All Done!

Your bundle has been successfully promoted and released.

  • To view the latest changes in the app:
  • Kill (close) the app completely, then
  • Reopen the app to load the updated JS bundle.
  • This ensures the latest changes are reflected properly.

πŸ” If not, try staying in the app for at least a minute before closing it. Then reopen it β€” your changes should now be visible.


βœ… Final Thoughts

Stallion makes the OTA update process seamless and efficient. With minimal setup and a powerful CLI, you can roll out bug fixes, feature updates, or UI tweaks instantlyβ€”keeping your app fresh and users happy.

Ready to streamline your React Native deployment?
Start using Stallion today and revolutionize your mobile development workflow.


πŸ“š Reference Documentation

Top comments (1)

Collapse
 
damancancode profile image
Damancancode β€’

This tool is just Awesome ! Best OTA solution till date by far

Image of Datadog

Keep your GPUs in check

This cheatsheet shows how to use Datadog’s NVIDIA DCGM and Triton integrations to track GPU health, resource usage, and model performanceβ€”helping you optimize AI workloads and avoid hardware bottlenecks.

Get the Cheatsheet

πŸ‘‹ Kindness is contagious

DEV shines when you're signed in, unlocking a customized experience with features like dark mode!

Okay