
Backgroundtasks
- 219 installs
- 297 repo stars
- Updated August 4, 2026
- vabole/apple-skills
Implement iOS and macOS BackgroundTasks for deferred sync, refresh, processing, and push-triggered work within system budget and lifecycle rules.
About
Skill for Apple BackgroundTasks on iOS and macOS: register identifiers, schedule refresh and processing work, handle push wakes, and respect system time and power limits so mobile apps sync data reliably without App Store rejection risk.
- BGTaskScheduler registration
- BGAppRefresh and processing tasks
- Push notification backgrounds
- System budget and expiry handling
- Battery-aware deferral patterns
Backgroundtasks by the numbers
- 219 all-time installs (skills.sh)
- +5 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #417 of 1,039 Mobile Development skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/vabole/apple-skills --skill backgroundtasksAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 219 |
|---|---|
| repo stars | ★ 297 |
| Last updated | August 4, 2026 |
| Repository | vabole/apple-skills ↗ |
What it does
Implement iOS and macOS BackgroundTasks for deferred sync, refresh, processing, and push-triggered work within system budget and lifecycle rules.
Files
BackgroundTasks Documentation
Search these docs to answer questions about background task APIs.
Return Format
Always include: 1. Summary - Answer the question concisely 2. File paths - List relevant files for full details
Files
backgroundtasks-index.md- Framework overview, task typesbgtaskscheduler.md- Task scheduling and registration
Navigation: BackgroundTasks
Essentials
Getting the shared task scheduler
Checking task requirements
Scheduling a task
- func register(forTaskWithIdentifier: String, using: dispatch_queue_t?, launchHandler: (BGTask) -> Void) -> Bool)
- func submit(BGTaskRequest) throws)
Canceling a task
Getting all scheduled tasks
- [func getPendingTaskRequests(completionHandler: ([BGTaskRequest]) -> Void)](/documentation/backgroundtasks/bgtaskscheduler/getpendingtaskrequests(completionhandler:))
Handling errors
Getting the error codes
Identifying an error
Initializers
- static var notPermitted: BGTaskScheduler.Error.Code
- static var tooManyPendingTaskRequests: BGTaskScheduler.Error.Code
- static var unavailable: BGTaskScheduler.Error.Code
Getting the error domain
Type Properties
Identifying an error
Initializers
Reading Task Information
Configuring a Task
Background tasks
- Using background tasks to update your app
- Refreshing and Maintaining Your App Using Background Tasks
- Choosing Background Strategies for Your App
- BGProcessingTask
- BGAppRefreshTask
- BGHealthResearchTask
Foreground tasks with background support
Titling the task
Task requests
Initializing a Processing Task Request
Setting Task Request Options
Initializing a refresh task request
Configuring a Task Request
Setting file permissions
Creating a task request
Identifying resource dependencies
- var requiredResources: BGContinuedProcessingTaskRequest.Resources
- BGContinuedProcessingTaskRequest.Resources
Identiying a resource
Creating a resource
Choosing a processing strategy
- var strategy: BGContinuedProcessingTaskRequest.SubmissionStrategy
- BGContinuedProcessingTaskRequest.SubmissionStrategy
Choosing a strategy
Creating a strategy
Titling the task
Development and testing
---
Extracted from Apple DocC JSON by apple-skills tooling. This is unofficial content. All documentation belongs to Apple Inc.
Navigation: BackgroundTasks
Class
BGTaskScheduler
Available on: iOS 13.0+, iPadOS 13.0+, Mac Catalyst 13.1+, tvOS 13.0+, visionOS 1.0+
A class for scheduling tasks that add background support to your app’s most critical work.
class BGTaskSchedulerOverview
Background tasks give your app a way to run code even when the app is suspended:
- To register, schedule, and run tasks in the background, see Using background tasks to update your app.
- To submit work in the foreground that can finish even if the app moves to the background, see Performing long-running tasks on iOS and iPadOS.
Inherits From
Conforms To
Getting the shared task scheduler
- shared The shared background task scheduler instance.
Checking task requirements
- supportedResources Additional system resources that a continuous background task can request.
Scheduling a task
- register(forTaskWithIdentifier:using:launchHandler:)) Register a launch handler for the task with the associated identifier that’s executed on the specified queue.
- submit(_:)) Submit a previously registered background task for execution.
Canceling a task
- cancel(taskRequestWithIdentifier:)) Cancel a previously scheduled task request.
- cancelAllTaskRequests()) Cancel all scheduled task requests.
Getting all scheduled tasks
- getPendingTaskRequests(completionHandler:)) Request a list of unexecuted scheduled task requests.
Handling errors
- BGTaskScheduler.Error The Errors for the
BGTaskSchedulerErrordomain. - BGTaskScheduler.Error.Code An enumeration of the task scheduling errors.
- errorDomain The background tasks error domain as a string.
Essentials
- Background Tasks updates Learn about important changes in Background Tasks.
- BGTask An abstract class for the framework’s tasks.
---
Extracted from Apple DocC JSON by apple-skills tooling. This is unofficial content. All documentation belongs to Apple Inc.