コンテンツにスキップ

チャンネル

Channels are the core mechanism for managing app updates in Capgo. They allow you to control how and when your users receive updates, enabling features like A/B testing, staged rollouts, and platform-specific updates.

チャンネルは、アプリのアップデートの配布トラックを表します。各チャンネルは、特定のルールと制約とともに構成できます:

  • バンドル(バージョン)制御:指定されたバンドル(バージョン)のユーザーを受け取る
  • :iOS/Android/Electronなどの特定のプラットフォームをターゲットにする「チャンネルの理解」のセクション
  • アップデートポリシー: アップデートの配信方法を制御します
  • デバイス制限: アップデートにアクセスできるデバイスを管理します
  • public: 新しいデバイスのデフォルトチャネルとして設定します
  • disableAutoUpdateUnderNative: デバイスのネイティブアプリのバージョンがアップデートパッケージのバージョンよりも新しい場合、自動アップデートを防止します (例: デバイスのネイティブアプリバージョンは 1.2.3、チャネルにはバージョン 1.2.2 のパッケージが含まれています)
  • disableAutoUpdate: アップデートの動作を制御します (“メジャー”, “マイナー”, “バージョン番号”, “なし”)
  • ios/android/electron: 可以突得、給源中心的类。
  • allow_device_self_set: 设置机器认向一个类。
  • allow_emulator: 安装器中心的更新。
  • allow_dev: 安装系统会库的更新。

Best Practices

此当前的求学。
  1. Testing Channel: 安装类中心的类。
  2. ステージング リリース: 複数のチャネルを使用して段階的なアップデートの展開
  3. プラットフォーム分離: iOS、Android、および Electron の場合に必要な場合に別々のチャネルを作成
  4. バンドル (バージョン) コントロール: 明確なアップデート パスのためにシーケンス バージョニングを使用

https://api.capgo.app/channel/

チャネル構成を生成または更新します。

type disable_update = "major" | "minor" | "version_number" | "none"
interface ChannelSet {
app_id: string
channel: string
version?: string // bundle (version) name
public?: boolean
disableAutoUpdateUnderNative?: boolean
disableAutoUpdate?: disable_update
ios?: boolean
android?: boolean
electron?: boolean
allow_device_self_set?: boolean
allow_emulator?: boolean
allow_dev?: boolean
}
ターミナル ウィンドウ
curl -X POST \
-H "authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"app_id": "app_123",
"channel": "beta",
"version": "1.2.0",
"public": false,
"disableAutoUpdate": "minor",
"ios": true,
"android": true,
"electron": true,
"allow_emulator": true
}' \
https://api.capgo.app/channel/
{
"status": "ok"
}

https://api.capgo.app/channel/

チャンネル情報を取得します。1ページあたり50のチャンネルを返します。

  • app_id: 必須。アプリの ID
  • page: オプション。ページネーションの場合のページ番号
  • channel: オプション。特定のチャンネル名を取得する
ターミナル ウィンドウ
# Get all channels
curl -H "authorization: your-api-key" \
"https://api.capgo.app/channel/?app_id=app_123"
# Get specific channel
curl -H "authorization: your-api-key" \
"https://api.capgo.app/channel/?app_id=app_123&channel=beta"
# Get next page
curl -H "authorization: your-api-key" \
"https://api.capgo.app/channel/?app_id=app_123&page=1"
interface Channel {
id: number;
created_at: string;
name: string;
app_id: string;
version: { // bundle (version) assigned to the channel
id: number,
name: string
};
created_by: string;
updated_at: string;
public: boolean;
disableAutoUpdateUnderNative: boolean;
disableAutoUpdate: boolean;
allow_emulator: boolean;
allow_dev: boolean;
}

以下のレスポンスの説明 version __CAPGO_KEEP_0__はチャンネルに割り当てられたバンドル(バージョン)を指します。

{
"data": [
{
"id": 1,
"name": "production",
"app_id": "app_123",
"version": {
"id": 1,
"name": "1.0.0"
},
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z",
"created_by": "user_123",
"public": true,
"disableAutoUpdateUnderNative": false,
"disableAutoUpdate": false,
"allow_emulator": false,
"allow_dev": false
}
]
}

https://api.capgo.app/channel/

このチャンネルを使用しているすべてのデバイスに影響を与えるため、チャンネルを削除してください。

interface Channel {
channel: string
app_id: string
}
ターミナルウィンドウ
curl -X DELETE \
-H "authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"app_id": "app_123",
"channel": "beta"
}' \
https://api.capgo.app/channel/
{
"status": "ok"
}

エラーの一般的なシナリオとそのレスポンス:

// Channel not found
{
"error": "Channel not found",
"status": "KO"
}
// Invalid bundle (version) format
{
"error": "Invalid version format. Use semantic versioning",
"status": "KO"
}
// Invalid update policy
{
"error": "Invalid disableAutoUpdate value",
"status": "KO"
}
// Permission denied
{
"error": "Insufficient permissions to manage channels",
"status": "KO"
}
  1. ベータテスト
{
"app_id": "app_123",
"channel": "beta",
"version": "1.2.0-beta",
"public": false,
"allow_emulator": true,
"allow_dev": true
}
  1. 本番展開
{
"app_id": "app_123",
"channel": "production",
"version": "1.2.0",
"public": true,
"disableAutoUpdate": "minor"
}
  1. プラットフォーム固有の更新
{
"app_id": "app_123",
"channel": "ios-hotfix",
"version": "1.2.1",
"ios": true,
"android": false
}