- Регистрация
- 1 Мар 2015
- Сообщения
- 1,481
- Баллы
- 155
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.
? Step 1: Set Up Your Stallion Account
Begin by creating a free Stallion account:
? and sign up.
Once you're in, create a new project. You'll see a series of screens like the following:
Screenshot 1 – Dashboard View
Screenshot 2 – Click "Create Project"
Screenshot 3 – Fill in Project Details
Screenshot 4 – Project Created
Screenshot 5 – Bucket Create View
click on create bucket
Screenshot 6 – Create New Bucket
? 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
? 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
Then, install CocoaPods for iOS:
npx pod-install
? Step 4: Configure Native Projects
Android Configuration
For React Native < 0.76
In MainApplication.java, override 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());
}
}
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)
}
}
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
}
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
}
? Step 5: Add Project ID and App Token
Add your Stallion credentials to platform-specific config files.
iOS (Info.plist):
<key>StallionProjectId</key>
<string>your_project_id</string>
<key>StallionAppToken</key>
<string>your_app_token</string>
Android (res/values/strings.xml):
<string name="StallionProjectId">your_project_id</string>
<string name="StallionAppToken">your_app_token</string>
You can generate your app token in the Stallion dashboard:
Click on Generate App Token button in order to get app token
? 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);
? Step 7: Create a Release Build
Android:
# macOS
./gradlew assembleRelease
# Windows
gradlew.bat assembleRelease
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
Authenticate in your browser and paste the token back into the terminal.
2. Publish the update:
npx stallion publish-bundle \
--upload-path=orgname/project-name/bucket-name \
--platform=android \
--release-note="Updated welcome text"
? 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:
? Step 10: Promote and Release the Bundle
Screenshot 1: Stallion Dashboard View
Click on tab inside the Android Bundles
Screenshot 2: Bundle Detail View
Add the release notes then click on Promote Bundle
Screenshot 3: Promote Bundle View
-click on target version you are targeting and then click on promote
Screenshot 4: Once done click on manage release
Screenshot 5: promoting to stage build to Production
Add the release notes and make rollout t0 100% then click on Publish Changes
Now all done, we are now good to go
Restart the app. You should see the changes without reinstalling the APK—OTA magic at work!
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
This guide walks you through setting up Stallion and publishing your first OTA update.
? Step 1: Set Up Your Stallion Account
Begin by creating a free Stallion account:
? and sign up.
Once you're in, create a new project. You'll see a series of screens like the following:
Screenshot 1 – Dashboard View
Screenshot 2 – Click "Create Project"
Screenshot 3 – Fill in Project Details
Screenshot 4 – Project Created
Screenshot 5 – Bucket Create View
click on create bucket
Screenshot 6 – Create New Bucket
? 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
? 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
Then, install CocoaPods for iOS:
npx pod-install
? Step 4: Configure Native Projects
Android Configuration
For React Native < 0.76
In MainApplication.java, override 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());
}
}
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)
}
}
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
}
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
}
? Step 5: Add Project ID and App Token
Add your Stallion credentials to platform-specific config files.
iOS (Info.plist):
<key>StallionProjectId</key>
<string>your_project_id</string>
<key>StallionAppToken</key>
<string>your_app_token</string>
Android (res/values/strings.xml):
<string name="StallionProjectId">your_project_id</string>
<string name="StallionAppToken">your_app_token</string>
You can generate your app token in the Stallion dashboard:
Click on Generate App Token button in order to get app token
? Find your Project ID and App Token under Project Settings in the Stallion Dashboard.
? 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);
? Step 7: Create a Release Build
Android:
# macOS
./gradlew assembleRelease
# Windows
gradlew.bat assembleRelease
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
Authenticate in your browser and paste the token back into the terminal.
2. Publish the update:
npx stallion publish-bundle \
--upload-path=orgname/project-name/bucket-name \
--platform=android \
--release-note="Updated welcome text"
? 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:
? Step 10: Promote and Release the Bundle
- - Open the Stallion Dashboard.
- - Click View Details on the latest bundle.
- - Click Promote Bundle, set the Target Version and Release Notes.
- - Click Manage Release, roll out to 100%, and hit Publish Changes.
Screenshot 1: Stallion Dashboard View
Click on tab inside the Android Bundles
Screenshot 2: Bundle Detail View
Add the release notes then click on Promote Bundle
Screenshot 3: Promote Bundle View
-click on target version you are targeting and then click on promote
Screenshot 4: Once done click on manage release
Screenshot 5: promoting to stage build to Production
Add the release notes and make rollout t0 100% then click on Publish Changes
Now all done, we are now good to go
? Step 11: Test the OTA UpdateNote: Please follow above for iOS as well
Restart the app. You should see the changes without reinstalling the APK—OTA magic at work!
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