background-tasks
Installation
SKILL.md
Background Tasks
Apple's BackgroundTasks framework for scheduling and running work while your app is suspended or backgrounded.
Choose the right task type
| Goal | Task class | Time limit | Trigger |
|---|---|---|---|
| Short content refresh | BGAppRefreshTask |
~30 seconds | System-decided |
| Heavy processing (ML, DB, sync) | BGProcessingTask |
Minutes | System-decided, device idle |
| Foreground job that must survive backgrounding | BGContinuedProcessingTask |
Unlimited | User action only |
| Health research data processing | BGHealthResearchTask |
Minutes | System-decided, device idle |
Limits: max 1 refresh task + 10 processing tasks schedulable at any time.
Decision tree
- Setting up for the first time?
→
references/setup.md(Info.plist keys, UIBackgroundModes, registration)