アップデートタイプ
このプラグインのセットアッププロンプトをコピーします。インストール手順とフルマークダウンガイドが含まれます。
Capgoは、オーバー・ザ・エア(OTA)アップデートのいくつかのタイプをサポートしています。このページでは、すべてのタイプをリストし、説明を付けて、適切な組み合わせを選択できるようにします。
適用タイミング
「適用タイミング」のセクションコントロール 時点 ダウンロード後、自動でアップデートが適用されます。
| タイプ | 説明 | 使用シナリオ |
|---|---|---|
autoUpdate: atBackground | バックグラウンドでダウンロードし、ユーザーがアプリをバックグラウンドに送ったり、アプリを強制終了したときに適用 | ほとんどのアプリ; 最小限の影響 |
autoUpdate: atInstall | 新規ユーザーには最新版を適用し、既存のユーザーにはデフォルトフローを使用 | 新規ユーザーには最新版を適用し、既存のユーザーにはデフォルトフローを使用 |
autoUpdate: onLaunch | インストール、ストアのアップデート、またはアプリの強制終了後に即座に適用 | 新鮮さとセッションの安定性のバランス |
__CAPGO_KEEP_0__: always | ダウンロードが完了した時点で即時適用 (再開時も含む) | 重要な修正、状態が単純なアプリ |
__CAPGO_KEEP_0__: onlyDownload | 自動ダウンロードして通知するが、適用や次のバンドルを自動で設定しない updateAvailableユーザーが更新の表示を自ら行うアプリや、適用タイミングを完全に制御するアプリ | 設定画面の set() |
クリップボードにコピー capacitor.config.ts:
plugins: { CapacitorUpdater: { autoUpdate: 'atBackground', // default; true is still accepted // or: 'off' | 'atInstall' | 'onLaunch' | 'always' | 'onlyDownload' }}Delay Conditions
Section titled “Delay Conditions”Conditions that must be met before an update is installed. Use setMultiDelay to combine them (all conditions must be satisfied).
| Condition | Description | Example |
|---|---|---|
| date | 特定の日時まで待ってください | サーバーサイドのリリースと調整してください |
| バックグラウンド | アプリがバックグラウンドに移動した後 (ms) までの最小時間待ってください | アプリのスイッチが速い場合に適用を避けてください |
| nativeVersion | native バイナリの最小バージョンを要求してください | 不互換のnative code に対してのアップデートをブロックしてください |
| kill | アプリの次のkill イベントまで待ってください | フルリスタートのみに適用してください |
import { CapacitorUpdater } from '@capgo/capacitor-updater';
await CapacitorUpdater.setMultiDelay({ delayConditions: [ { kind: 'date', value: '2023-06-01T00:00:00.000Z' }, { kind: 'background', value: '60000' }, ],});バージョンブロッキング(チャネルポリシー)
バージョンブロッキング(チャネルポリシー)制御する semver更新 チャネルが自動で配信する更新 --disable-auto-update 設定方法は
| チャネルごとに | 戦略 | Allows | Use Case |
|---|---|---|---|
| none | Nothing | All updates | Default; full auto-update |
| major | 0.0.0 → 1.0.0 | Same major (e.g. 1.x → 1.y) | Prevent breaking changes from reaching old native |
| minor | 0.0.0 → 1.1.0, 1.1.0 → 1.2.0 | Same minor (e.g. 1.2.x → 1.2.y) | Stricter control within major |
| パッチ | パッチ以外の変更 | 0.0.311 → 0.0.314 のみ | 非常に厳格; パッチのみの更新 |
| メタデータ | メタデータなしの更新 min_update_version | 明示的な互換性メタデータありの更新 | バンドルごとのカスタム互換性ルール |
npx @capgo/cli channel set production --disable-auto-update major配信タイプ
セクション「配信タイプ」デバイスにバンドルが転送される方法について タイプ to the device.
| Type | 説明 | 使用するとき |
|---|---|---|
| フルバンドル | 全てのJSバンドルがダウンロードされます | 初回インストール、大きい変更、またはデルタが利用できない場合 |
| デルタ(マニフェスト) | 変更されたファイルのみがダウンロードされます | ほとんどの更新; 速く帯域幅効率の良い |
# Full bundle (default)npx @capgo/cli bundle upload --channel production
# Delta updatesnpx @capgo/cli bundle upload --channel production --delta適用タイミング
遅延条件| バージョンブロッキング | __CAPGO_KEEP_0__ |
|---|---|
| __CAPGO_KEEP_1__ | off, atBackground, atInstall, onLaunch, always, onlyDownload |
| __CAPGO_KEEP_2__ | date, background, nativeVersion, kill |
| __CAPGO_KEEP_3__ | none, major, minor, patch, metadata |
| 配信 | フルバンドル、デルタ(マニフェスト) |
- 更新動作 — アプリケーション適用タイミングと遅延の設定
- バージョン対象 — チャネルベースのバージョンルーティング
- デルタ(マニフェスト)更新 — パーティアルダウンロードの有効化
- チャネル — チャネル構成と優先順位の設定
Keep going from Update Types
Section titled “Keep going from Update Types”If you are using Update Types to plan live update delivery, connect it with Capgo Live Updates Capgo Live Updates __CAPGO_KEEP_0__ Live Updates for the implementation detail in Overview, Features for the implementation detail in Features, Update Behavior Update Behaviorの実装詳細については、 Getting Started Getting Startedの実装詳細については、