iOS setup
Copy a setup prompt with the install steps and the full markdown guide for this plugin.
iOS background processing uses BGTaskScheduler. The app must declare the background mode and the permitted task identifier before scheduling can work on a physical device.
Info.plist
Section titled โInfo.plistโAdd these keys to ios/App/App/Info.plist:
<key>UIBackgroundModes</key><array> <string>processing</string></array><key>BGTaskSchedulerPermittedIdentifiers</key><array> <string>app.capgo.backgroundtask.processing</string></array>npx cap sync iosBehavior
Section titled โBehaviorโminimumIntervalis mapped toearliestBeginDate.- iOS decides the actual run time based on battery, network, usage patterns, and system policy.
- Background task execution does not run reliably in the simulator. Test on a physical device.
- The plugin re-schedules the next background processing request after each task launch.
Expiration
Section titled โExpirationโUse addExpirationListener when work needs cleanup if iOS ends the task early.
const handle = await BackgroundTask.addExpirationListener((event) => { console.warn('Task expired', event.taskName);});
await handle.remove();