dpearson2699 avatar

Background Processing

Covers the three main flavors of iOS background work: BGAppRefreshTask for quick data syncs, BGProcessingTask for longer maintenance jobs, and the new BGContinuedProcessingTask in iOS 26+ for user-initiated work that keeps running when the app backgrounds. The patterns here handle the critical bits like Info.plist setup, registration timing (which must happen before app launch completes), and expiration handlers that fire when the system pulls the plug. Also includes background URLSession for downloads and push notification triggers. The examples show async/await patterns with proper cancellation, which is better than the older completion handler style you'll find in Apple's docs.

skills.sh installs
4.1K
GitHub stars
1.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add dpearson2699/swift-ios-skills --skill background-processing --agent claude-code

Installs into .claude/skills of the current project.

Files

Background Processing

Register, schedule, and execute background work on iOS using the BackgroundTasks framework, background URLSession, and background push notifications.

Contents

Info.plist Configuration

Every task identifier must be declared in Info.plist under BGTaskSchedulerPermittedIdentifiers, or submit(_:) throws BGTaskScheduler.Error.Code.notPermitted.

<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:

Sponsors

Details

Repository
github.com/dpearson2699/swift-ios-skills
Categories
Debugging, Automation & Workflows, Mobile Development
First seen
Apr 16, 2026

More from dpearson2699/swift-ios-skills

All 98

Recommended

More Debugging
1bencium avatarui-typographybencium/bencium-marketplaceProfessional typography rules for UI design, web applications, software interfaces, and all screen-based text. Enforces timeless typographic correctness that LL4Kskills.sh installs
2inngest avatarinngest-durable-functionsinngest/inngest-skillsUse when building functions that must survive process crashes, retry automatically on failure, run on a schedule, react to events, or maintain state across infr4Kskills.sh installs
3dotnet avatarcreate-skill-testdotnet/skillsScaffolds eval.yaml evaluation specs for agent skills in the dotnet/skills repository. Use when creating skill tests, writing evaluation stimuli, defining grade4Kskills.sh installs
4giuseppe-trisciuoglio avatarnextjs-app-routergiuseppe-trisciuoglio/developer-kitProvides patterns and code examples for building Next.js 16+ applications with App Router architecture. Use when creating projects with App Router, implementing4Kskills.sh installs
5longbridge avatarlongbridge-portfoliolongbridge/skillsAccount assets, equity and fund positions, P&L, cash flow records, account statements, margin ratios, buy-power estimates, order management, and DCA recurring i4Kskills.sh installs
6softaworks avatardifficult-workplace-conversationssoftaworks/agent-toolkitStructured approach to workplace conflicts, performance discussions, and challenging feedback using preparation-delivery-followup framework. Use when preparing 4Kskills.sh installs