Skip to content

capawesome-team/cordova-live-update-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cordova Live Update Demo

Live Update Native Build

⚡️ A simple Apache Cordova app that demonstrates the Cordova Live Update plugin.

It ships with a pre-configured Capawesome Cloud app, so live updates work out of the box — no account or setup required. Just install the app and try it.

The demo app running on iOS, showing the v1 bundle badge and the live update status card

Features

  • 📦 Over-the-air updates — ship new web bundles without an app store release.
  • 🏷️ Visible version badge — a large v1 / v2 badge makes each update obvious on screen.
  • 🔀 Channel switching — move the device between live update channels at runtime.
  • ↩️ Automatic rollback — a faulty bundle is reverted to the last working one.
  • 🪶 No build step — plain HTML / CSS / JavaScript served straight from www/.

Tech Stack

Getting Started

Prerequisites

Installation

git clone https://github.com/capawesome-team/cordova-live-update-demo.git
cd cordova-live-update-demo
npm install
npx cordova platform add ios android

Running

# Android
npx cordova run android

# iOS
npx cordova run ios

The app is already wired to a live Capawesome Cloud app, so it receives updates automatically — no extra configuration needed.

Usage

The screen shows a large bundle badge (v1) and a status card with the current bundle ID, channel, device ID, and last sync time. When a newer bundle is published to the cloud, the app detects it on resume and offers to reload — and the badge changes to reflect the new bundle.

You don't need to publish anything to see this work. Every push to main automatically publishes a fresh bundle (see Continuous Integration), so there is normally an update waiting for you out of the box — just run the app and try it:

  1. Run the app on a device or simulator — the badge shows v1.
  2. Send the app to the background, then reopen it. It detects the update and asks to reload.
  3. Accept — the badge now shows v2. 🎉

Use Switch channel to move the device between channels, and Reset to built-in bundle to roll back to the bundle that shipped inside the app.

Configuration

The app uses a pre-configured demo cloud app out of the box. To publish your own bundles instead:

  1. Create an app in the Capawesome Cloud Console.
  2. Replace the APP_ID variable under cordova.plugins in package.json with your app ID.
  3. Re-apply the plugin: npx cordova prepare.

Continuous Integration

Two GitHub Actions workflows are included:

  • live-update.yml — bumps the badge to v2 and uploads the www/ bundle to Capawesome Cloud with the Capawesome CLI:

    npx @capawesome/cli apps:liveupdates:upload --app-id <APP_ID> --path www --channel default --yes

    Runs on every push to main (ignoring Markdown-only changes), weekly on a schedule (so there is always a fresh, non-expired bundle waiting), and on manual dispatch. Requires the CAPAWESOME_CLOUD_TOKEN secret.

  • native-build.yml — builds native Android and iOS apps in the cloud via Capawesome Cloud Native Builds. Requires the CAPAWESOME_CLOUD_TOKEN secret.

Learn More

  • LiveUpdate.ready() — call once on startup so a faulty bundle can be rolled back automatically if you never reach it.
  • sync() / reload() / reset() — check for a new bundle, apply it, or roll back to the built-in one.
  • Channels — route bundles to different audiences (e.g. default, beta). This demo uses the default channel.

See the plugin documentation for the full API.

License

Released under the MIT License.

About

⚡️ Simple Ionic app to demonstrate the use of the Cordova Live Update plugin.

Topics

Resources

License

Stars

Watchers

Forks

Contributors