---
title: Live Update Strategies
description: Choose the right OTA update strategy for your Capacitor or Cordova app — background, always-latest, force update, and instant update modes.
---

# Update Strategies

An update *strategy* decides **when** an update is downloaded, **when** it's applied, and **whether the user is involved**. The SDK supports four patterns, from "set it once and forget it" to "push an update on demand". Pick the default that fits your app.

## Background

The simplest option, with no app-side code. Set the `autoUpdateStrategy` option to `background` in your configuration:

=== "Capacitor"

    ```typescript title="capacitor.config.ts"
    const config: CapacitorConfig = {
      plugins: {
        LiveUpdate: {
          autoUpdateStrategy: "background",
          autoBlockRolledBackBundles: true // recommended
        }
      }
    };
    ```

=== "Cordova"

    ```xml title="config.xml"
    <preference name="AUTO_UPDATE_STRATEGY" value="background" />
    <preference name="AUTO_BLOCK_ROLLED_BACK_BUNDLES" value="true" />
    ```

This checks for the latest bundle **at app start and on resume** (throttled to once every 15 minutes), downloads it in the background, and applies it on the next launch — no code required. It's the easiest way to keep users up to date.

## Always Latest (recommended)

Get the background strategy's silent download, but prompt the user to apply the update as soon as it's ready instead of waiting for the next cold start. Keep `autoUpdateStrategy` set to `background` and listen for the `nextBundleSet` event:

=== "Capacitor"

    ```typescript
    import { LiveUpdate } from "@capawesome/capacitor-live-update";

    LiveUpdate.addListener("nextBundleSet", async ({ bundleId }) => {
      if (!bundleId) return;
      if (confirm("A new version is available. Install it now?")) {
        await LiveUpdate.reload();
      }
    });
    ```

=== "Cordova"

    ```javascript
    cordova.plugins.LiveUpdate.addListener("nextBundleSet", async ({ bundleId }) => {
      if (!bundleId) return;
      if (confirm("A new version is available. Install it now?")) {
        await cordova.plugins.LiveUpdate.reload();
      }
    });
    ```

The download happens in the background, so the prompt only appears once the bundle is fully on disk — there's no waiting when the user taps "install".

## Force Update

The "users must be on the latest version before they can use the app" strategy. Keep the splash screen visible while the update check runs, then `sync()` on app start and either `reload()` (if there's an update) or hide the splash:

=== "Capacitor"

    ```typescript
    import { SplashScreen } from "@capacitor/splash-screen";
    import { LiveUpdate } from "@capawesome/capacitor-live-update";

    const { nextBundleId } = await LiveUpdate.sync();
    if (nextBundleId) {
      await LiveUpdate.reload();
    } else {
      await SplashScreen.hide();
    }
    ```

    Disable the splash screen's auto-hide via `SplashScreen: { launchAutoHide: false }` in your config.

=== "Cordova"

    ```javascript
    const { nextBundleId } = await cordova.plugins.LiveUpdate.sync();
    if (nextBundleId) {
      await cordova.plugins.LiveUpdate.reload();
    } else {
      navigator.splashscreen.hide();
    }
    ```

    Keep the splash screen visible with `AutoHideSplashScreen=false` in your `config.xml`.

This guarantees freshness, but every cold start on a slow connection makes the user wait while the bundle downloads. Reserve it for apps where running a stale version is genuinely unsafe. Set `autoUpdateStrategy` to `none` to avoid running two update mechanisms at once.

## Instant

For critical updates, trigger an update with a **silent push notification** that tells the app to check for an update *now*. When the silent notification arrives, call `sync()` and `reload()`. This requires push infrastructure (such as Firebase Cloud Messaging) and is meant as a break-glass tool, not an everyday flow. Set `autoUpdateStrategy` to `none`.

## Further reading

Want to combine Live Updates with native app store updates? See [Capacitor App Updates: The Complete Guide](../../blog/posts/capacitor-app-update-guide.md).
