Channels
Channels help manage updates across different environments (development, staging, production) and deliver updates to specific user groups or separate applications.
Channels are not limited to environment management alone—they also support managing multiple apps distinctly (e.g., app2, app3, app4), each using its own dedicated channel.
Channel Overview
- Default Channel: Apps default to the
production
channel if no channel is specified.
- Environment Management: Clearly separates different environments (
dev
, staging
, production
) to ensure accurate application of updates.
Setting Up Channels
1. Specify Channel in Configuration File
npx hot-updater channel set <channel>
The values that change when you run the command above.
ios/HotUpdaterExample/Info.plist
<key>HOT_UPDATER_CHANNEL</key>
<string>your_set_channel</string>
2. Rebuild App with New Channel
After specifying the new channel, rebuild your native app:
cd ios && pod install && cd ..
npx react-native run-ios --mode Release
3. Specify Channel Deployment
You can also specify the target channel directly during deployment:
npx hot-updater deploy -p <"ios" | "android"> -c "<channel>"
Replace <channel>
with your target channel name (e.g., dev
, staging
, production
).
Retrieving the Current Channel
Use the HotUpdater.getChannel()
function to retrieve the current release channel within your app.
We recommend displaying this value in your app UI to visually confirm that it’s using the intended update channel.
Example Usage
import { HotUpdater, getUpdateSource } from "@hot-updater/react-native";
import { Text, View } from "react-native";
function App() {
const channel = HotUpdater.getChannel();
return (
<View>
<Text>Current Channel: {channel}</Text>
</View>
);
}
export default HotUpdater.wrap({
source: getUpdateSource("<your-update-server-url>"),
})(App);
Channel Behavior
- Defaults to
production
if no channel is specified.
- Channels ensure separation of different environments (e.g.,
dev
, staging
, production
) to apply updates accurately.
- Updates can subsequently be deployed using
hot-updater deploy -c <channel>
.
- Important: Changing the channel requires rebuilding the native app; simply altering the configuration file or deployment commands will not affect an already built app.