Skip to content

Android behavior

Android scheduling is backed by WorkManager. No extra app manifest entry is required for normal periodic background fetch work.

await BackgroundTask.registerTaskAsync('sync-offline-data', {
minimumInterval: 30,
requiresNetwork: true,
});
  • Android enforces a 15 minute minimum interval for periodic work.
  • requiresNetwork: true maps to WorkManager’s connected network constraint.
  • Each task name is scheduled as unique periodic work, so registering the same task name updates the existing schedule.
  • Task runs are recorded natively before being delivered to JavaScript, so pending events can be drained when the WebView is ready.

Use the test trigger to execute registered callbacks immediately during development:

await BackgroundTask.triggerTaskWorkerForTestingAsync();

WorkManager is designed for deferrable work. It does not guarantee exact timing and should not be used for alarms, countdowns, or user-visible deadlines.

If you are using Android behavior to plan native plugin work, connect it with Using @capgo/capacitor-background-task for the native capability in Using @capgo/capacitor-background-task, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins, and Ionic Enterprise Plugin Alternatives for the product workflow in Ionic Enterprise Plugin Alternatives.