Zum Hauptinhalt springen
@capgo/cordova-updater Updates Open Source

Cordova Updater Cordova-Plugin

OTA-Live-Updates für Cordova iOS und Android mit demselben API wie beim capacitor-Updater

Installieren

bun add @capgo/cordova-updater
npm, pnpm oder yarn
  • npm install @capgo/cordova-updater
  • pnpm add @capgo/cordova-updater
  • yarn add @capgo/cordova-updater

Anleitung

So verwendest du Cordova Updater in Cordova

Verwendung von @capgo/cordova-updater

@capgo/cordova-updater bringt Capgo Live Updates in Cordova iOS- und Android-Apps mit demselben JavaScript API wie @capgo/capacitor-updater. Installiere das Cordova-Plugin, rufe notifyAppReady() bei jedem Start auf und lade Bundles mit @capgo/cli.

Installation

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

Basic usage

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 });
  }
});

Plattformanforderungen

  • Cordova Android 13+ und Cordova iOS 7+
  • Standard-Cordova-WebView-Schemes (https://localhost/ auf Android, app://localhost/ auf iOS)
  • Vermeide cordova-plugin-ionic-webview — verhindert das Bundle-Swapping

Neues Bundle deployen

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

Praxis-Tipps

  • Nutze dieselbe Capgo App-ID und dieselben Kanäle, wenn du auch einen Capacitor- oder Electron-Client auslieferst.
  • Behandle native Plugin- oder Cordova-Plattform-Upgrades wie jede andere native Änderung: Liefere ein neues Store-Binary aus, bevor du neue native APIs in JavaScript-Bundles nutzt.
  • Alle Details zur Einrichtung findest du in der Cordova-Updater-Docs.

FAQ

FAQ zum Cordova Updater-Plugin

Wie installiere ich das Cordova Updater-Plugin in einer Cordova-App?

Führe "bun add @capgo/cordova-updater" (oder "npm install @capgo/cordova-updater") aus und befolge anschließend die Cordova-Einrichtungsschritte im Guide sowie das GitHub-README.

Funktioniert @capgo/cordova-updater mit React, Vue und Angular?

Ja. Cordova Updater ist ein Cordova-Paket und funktioniert daher mit jedem Web-Framework, das in Cordova läuft – React, Vue, Angular, Svelte und reines JavaScript.

Ist @capgo/cordova-updater kostenlos und Open Source?

Ja. Der Quellcode von code ist öffentlich auf GitHub unter https://github.com/Cap-go/cordova-updater/ verfügbar und das Paket kann kostenlos von npm installiert werden. Bug-Reports und Pull Requests sind willkommen.

Cordova-Updater-Änderungen veröffentlichen, ohne auf die App-Prüfung zu warten

Sobald das Plugin in deinem Store-Build ist, bringt Capgo mit Live-Updates deine JavaScript-, HTML- und CSS-Änderungen in Minuten zu den Nutzern.

Starte mit Capgo