__CAPGO_KEEP_0__
プラグインに戻る
@capgo/cordova-updater
チュートリアル
@capgo/cordova-updater

コルダバアップデート

OTA live updates for Cordova iOS and Android with the same API as capacitor-updater

ガイド

Cordova Updaterのチュートリアル

Using @capgo/cordova-updater

@capgo/cordova-updater brings Capgo live updates to Cordova iOS and Android apps with the same JavaScript API as @capgo/capacitor-updaterインストール notifyAppReady() 基本的な使用方法 @capgo/cli.

brings __CAPGO_KEEP_0__ live updates to Cordova iOS and Android apps with the same JavaScript __CAPGO_KEEP_1__ as

cordova plugin add @capgo/cordova-updater --variable APP_ID=com.example.app
cordova prepare android ios

on every launch, and upload bundles with

document.addEventListener('deviceready', async () => {
  const { Updater } = cordova.plugins;

  await Updater.notifyAppReady();

  const { bundle } = await Updater.current();
  console.log('Active bundle', bundle);

  const latest = await Updater.getLatest();
  if (latest.url && !latest.error) {
    const downloaded = await Updater.download({
      url: latest.url,
      version: latest.version,
      checksum: latest.checksum,
    });

    await Updater.next({ id: downloaded.id });
  }
});

プラットフォーム要件

  • コルダバアンドロイド 13+ およびコルダバiOS 7+
  • デフォルトのコルダバウェブビューのスキーム (https://localhost/ アンドロイドの場合、 app://localhost/ iOSの場合)
  • 回避 cordova-plugin-ionic-webview — これはバンドル交換を防止します

新しいバンドルを展開

bun run build
bunx @capgo/cli@latest bundle upload --channel=production

実用的なアドバイス

  • Reuse the same Capgo app ID and channels if you also ship a Capacitor or Electron client.
  • ネイティブ プラグインまたはコルダバ プラットフォームのアップグレードは、他のネイティブの変更と同じように扱います: ストアの新しいバイナリを配信する前に、JavaScript バンドルで新しいネイティブ API を使用するのを待ってください。
  • 全体設定の詳細は コルダバ更新プログラムのドキュメント.