Skip to content

Channel Management

Manage deployment channels for your React Native app using the channel command.

What are Channels?

Channels allow you to maintain separate update streams for different environments or user groups. Common channels include:

  • production - Updates for your end users
  • staging - Updates for internal testing before production release
  • beta - Updates for beta testers
  • development - Updates for active development

Each channel has its own API key and independent deployment history.

Commands

Display Current Channel

Show the configured channel for iOS and Android:

bash
silverbullet-ota channel

Example output:

Current Channels:
  iOS:     production (from ios/MyApp/Info.plist)
  Android: production (from android/app/src/main/res/values/strings.xml)

Set Channel

Update the channel configuration for both platforms:

bash
silverbullet-ota channel set <channel>

Example:

bash
silverbullet-ota channel set staging

Output:

✓ Updated iOS channel to: staging
✓ Updated Android channel to: staging
⚠ You must rebuild your native app for changes to take effect!

How Channels Work

Channels are configured in your native code and embedded at build time. This means:

  1. Build-time Configuration: Channel values are set when you build your app
  2. Runtime Behavior: The app checks for updates only from its configured channel
  3. No Hot-Switching: You cannot change channels without rebuilding the app

Native Configuration

iOS: Stored in Info.plist

xml
<key>SILVERBULLET_OTA_CHANNEL</key>
<string>production</string>

Android: Stored in strings.xml

xml
<string name="silverbullet_ota_channel" moduleConfig="true">production</string>

Usage Examples

Switch to Staging

bash
# Set channel to staging
npx silverbullet-ota channel set staging

# Rebuild your app
npx react-native run-ios
npx react-native run-android

# Deploy to staging
npx silverbullet-ota deploy --platform ios --channel staging

Check Current Channel

Before deploying, verify which channel your app is configured for:

bash
npx silverbullet-ota channel

Per-Platform Channels

You can manually configure different channels for iOS and Android by editing the native files directly:

For iOS: Edit ios/YourApp/Info.plist:

xml
<key>SILVERBULLET_OTA_CHANNEL</key>
<string>beta</string>

For Android: Edit android/app/src/main/res/values/strings.xml:

xml
<string name="silverbullet_ota_channel" moduleConfig="true">staging</string>

WARNING

Manual edits will be overwritten if you run channel set again. For persistent per-platform configurations, consider using build variants or schemes.

Channel Workflow Example

Development Workflow

bash
# 1. Set to development channel
npx silverbullet-ota channel set development

# 2. Rebuild app
npx react-native run-ios

# 3. Make changes to your code
# ... edit files ...

# 4. Deploy to development channel
npx silverbullet-ota deploy --platform ios --channel development

# 5. Test the update
# ... restart app, verify changes ...

Staging → Production Workflow

bash
# 1. Deploy to staging first
npx silverbullet-ota deploy --platform ios --channel staging

# 2. Test on staging builds
# ... internal testing ...

# 3. If tests pass, deploy same bundle to production
npx silverbullet-ota deploy --platform ios --channel production

Build Variants and Channels

For production apps, you might want different builds with different channels:

iOS with Schemes

Create different schemes (Debug, Staging, Release) and configure Info.plist per scheme:

  1. Duplicate your Info.plist for each scheme
  2. Set different SILVERBULLET_OTA_CHANNEL values
  3. Configure your schemes to use the appropriate Info.plist

Android with Build Flavors

Use build flavors in android/app/build.gradle:

gradle
android {
    flavorDimensions "environment"
    productFlavors {
        development {
            dimension "environment"
            resValue "string", "silverbullet_ota_channel", "development"
        }
        staging {
            dimension "environment"
            resValue "string", "silverbullet_ota_channel", "staging"
        }
        production {
            dimension "environment"
            resValue "string", "silverbullet_ota_channel", "production"
        }
    }
}

Then build different variants:

bash
./gradlew assembleDevelopmentDebug
./gradlew assembleStagingDebug
./gradlew assembleProductionRelease

Next Steps