Android behavior
Copy a setup prompt with the install steps and the full markdown guide for this plugin.
Android scheduling is backed by WorkManager. No extra app manifest entry is required for normal periodic background fetch work.
Scheduling
Section titled “Scheduling”await BackgroundTask.registerTaskAsync('sync-offline-data', { minimumInterval: 30, requiresNetwork: true,});Behavior
Section titled “Behavior”- Android enforces a 15 minute minimum interval for periodic work.
requiresNetwork: truemaps 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.
Testing
Section titled “Testing”Use the test trigger to execute registered callbacks immediately during development:
await BackgroundTask.triggerTaskWorkerForTestingAsync();Limits
Section titled “Limits”WorkManager is designed for deferrable work. It does not guarantee exact timing and should not be used for alarms, countdowns, or user-visible deadlines.
Keep going from Android behavior
Section titled “Keep going from Android behavior”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.