background-processinglisted
Install: claude install-skill thienqo/ios-skills
# Background Processing
Register, schedule, and execute background tasks on iOS using BackgroundTasks (`BGTaskScheduler`), background `URLSession`, and background push notifications. Targets Swift 6.4 / iOS 26+.
## Contents
- [Capabilities and Configuration](#capabilities-and-configuration)
- [Task Selection Matrix](#task-selection-matrix)
- [Core Lifecycle Rules](#core-lifecycle-rules)
- [Route by Task](#route-by-task)
- [iOS 27 Updates](#ios-27-updates)
- [Common Mistakes](#common-mistakes)
- [Review Checklist](#review-checklist)
- [References](#references)
## Capabilities and Configuration
Every task identifier must be declared in `Info.plist` under `BGTaskSchedulerPermittedIdentifiers`, or `submit(_:)` throws `BGTaskScheduler.Error.Code.notPermitted`.
```xml
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>com.example.app.refresh</string>
<string>com.example.app.db-cleanup</string>
<string>com.example.app.export.*</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>fetch</string> <!-- Required for BGAppRefreshTask -->
<string>processing</string> <!-- Required for BGProcessingTask -->
<string>remote-notification</string> <!-- Required for silent push -->
</array>
```
In Xcode: Target > Signing & Capabilities > Background Modes > enable **Background fetch**, **Background processing**, or **Remote notifications**.
## Task Selection Matrix
| Task Type | Max Duration | Trigger | Requires Power/Network | Use Case