Options
All
  • Public
  • Public/Protected
  • All
Menu

@objekt/capacitor-app-updater

Index

References

Variables

References

Renames and re-exports AppUpdater

Variables

AppUpdater: { sync: (webServerURL: string, checkDelay?: number) => Promise<boolean> } = ...

CapacitorJS plugin to update the web contents of an app from a remote content server.

example
import { AppUpdater } from '@objekt/capacitor-app-updater';

// Check for app updates on the remote content server.
const didUpdate = await AppUpdater.sync("https://your-web-server-url", 1000*60*60); // Only check once every 60 minutes.

// Stop processing if there was an update, as the updated would have triggered a page reload.
if (didUpdate) {
return;
}

// Load the app shell.
// ... e.g. await import('./src/AppShell.js');

Type declaration

  • sync: (webServerURL: string, checkDelay?: number) => Promise<boolean>
      • (webServerURL: string, checkDelay?: number): Promise<boolean>
      • Syncs the online web app to the native app shell.

        Note: this function triggers a browser reload if the app was updated successfully to point to the new release.

        Parameters

        • webServerURL: string

          The URL of the online web server.

        • checkDelay: number = ...

          The amount of time to allow between update checks. Defaults to 60 minutes.

        Returns Promise<boolean>

        True, if the app was updated, otherwise false.

Generated using TypeDoc