• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

? How to Enable Over-the-Air (OTA) Updates in React Native Using Stallion

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
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


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



? 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

  1. - Open the Stallion Dashboard.
  2. - Click View Details on the latest bundle.
  3. - Click Promote Bundle, set the Target Version and Release Notes.
  4. - 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

Note: Please follow above for iOS as well
? Step 11: Test the OTA Update


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



Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу