← ClaudeAtlas

background-processinglisted

Schedule and execute background work on iOS using BGTaskScheduler. Use when registering BGAppRefreshTask for short background fetches, BGProcessingTask for long-running maintenance, BGContinuedProcessingTask (iOS 26+) for foreground-started work that continues in background, background URLSession downloads, or background push notifications. Covers Info.plist configuration, expiration handling, task completion, and debugging with simulated launches.
dpearson2699/swift-ios-skills · ★ 730 · AI & Automation · score 80
Install: claude install-skill dpearson2699/swift-ios-skills
# Background Processing Register, schedule, and execute background work on iOS using the BackgroundTasks framework, background URLSession, and background push notifications. ## Contents - [Info.plist Configuration](#infoplist-configuration) - [BGTaskScheduler Registration](#bgtaskscheduler-registration) - [BGAppRefreshTask Patterns](#bgapprefreshtask-patterns) - [BGProcessingTask Patterns](#bgprocessingtask-patterns) - [BGContinuedProcessingTask (iOS 26+)](#bgcontinuedprocessingtask-ios-26) - [Background URLSession Downloads](#background-urlsession-downloads) - [Background Push Triggers](#background-push-triggers) - [Common Mistakes](#common-mistakes) - [Review Checklist](#review-checklist) - [References](#references) ## Info.plist 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> ``` Also enable the required `UIBackgroundModes`: ```xml <key>UIBackgroundModes</key> <array> <string>fetch</string> <!-- Required for BGAppRefreshTask --> <string>processing</string> <!-- Required for BGProcessingTask --> </array> ``` In Xcode: target > Signing & Capabilities > Background Modes > enable "Background fetch" and "Background p