HotCodePush

Channels

A channel is the stream of releases a group of devices follows, such as production or staging, and a build, setChannel or a link picks it.

A channel is the named stream of releases a device follows. Every app has production from the moment it is created, and a device follows one channel at a time. A channel spans both platforms: a Capacitor or Cordova web bundle released once serves iOS and Android.

Production and preview channels

production is created with the app and is the default: a hotcodepush.json without a channel key names it. Further channels come from channel create or the console, and a build flavour gets its own by setting HOTCODEPUSH_CHANNEL for that build. Two shapes cover most teams:

  • Long-lived channels such as production, staging and beta serve one environment or audience each, each followed by its own builds. Set up environments and tenants models them.
  • Preview channels come one per pull request, created by the pipeline with an expiry and followed by a tester's build. Test with preview channels builds that flow.

The flags

FlagWhat it doesSet with
ProtectedOnly Owners and Admins change what the channel serves, and a Member's release, pause, resume, delete or expiry change is refused.Set it with channel update --protected or the console's Access island. Only an Owner or Admin turns it on or off.
DiscoverableThe channel's id and name join the app's public channels index, so setChannel({ name }) resolves the name on the device, and anyone holding the app id can read the names.Set it with channel update --discoverable or the console. It is off by default, production included.
ExpiryThe channel is deleted within a day of the date and the audit log records it. The default channel and a protected channel take no expiry.Set it with --expires-in 14d or --expires-at on channel create and channel update, or with Expires in the console.
PausedThe channel serves nothing new: devices keep what they run and skip every newer release until the channel is resumed.Set it with channel pause and channel resume, or the console. On a protected channel an Owner or Admin does it.

A channel's id is a random id that cannot be guessed, and nothing a device reads can be listed. So a channel whose id is in no binary, and that is not discoverable, can neither be found nor guessed. Privacy and device data lists what the public index exposes.

What a device follows

The SDK resolves its channel in a fixed order: the channel the app set at runtime first, then the one the build was stamped with. A build is stamped with the channel its hotcodepush.json names, or HOTCODEPUSH_CHANNEL where set, resolved to the channel's id at build time. So renaming a channel moves no device.

The call setChannel takes an id, which works for any channel, or a name, which works for a discoverable one. Passing null returns the device to the build's channel. The choice survives restarts, and the call fetches nothing by itself: the sync() after it picks up the channel's newest eligible release.

The call getChannel() answers the channel in effect with its source, runtime or config. Switch channels by link registers a URL scheme so a tester switches by opening a link or scanning a QR code. Which channel a device follows is decided on the device, by the build and the app. HotCodePush never assigns one.

Pausing and deleting a channel

Pausing a channel is the kill switch for a whole stream. Pausing one release instead is on Rollouts and auto-pause. Pausing, resuming and deleting apply within about a minute, as How an update reaches a device describes.

Deleting a channel removes its index, and the default channel cannot be deleted. A device that finds no index keeps the bundle it has and its channel, and every check reports channel_unknown. The SDK never resets the channel on its own. A deleted preview channel leaves its testers where they are until the app calls setChannel(null), and Switch channels by link has the handler.

Last updated on

On this page