background-processing

Schedule and execute iOS background tasks with correct registration and completion handling.

Updated May 10, 2026
One-click install
npx skills add https://github.com/FelixRauch/medat-figuren --skill background-processing-felixrauch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: background-processing
Source: https://github.com/FelixRauch/medat-figuren/tree/main/.agents/skills/background-processing
Command: npx skills add https://github.com/FelixRauch/medat-figuren --skill background-processing-felixrauch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Background work scheduling is unreliable unless identifiers, capabilities, and task completion semantics are implemented correctly, which can cause tasks to never run or fail silently.

Core Features & Use Cases

  • BGTaskScheduler registration and scheduling for BGAppRefreshTask and BGProcessingTask, including correct Info.plist permitted identifiers and background modes.
  • Expiration-safe execution using expirationHandler cancellation and guaranteed task.setTaskCompleted(success:) on all paths.
  • Long-running and continued processing support via BGContinuedProcessingTask (iOS 26+) with progress reporting, plus background URLSession downloads and background push-triggered fetches.

Use case: A MedAT app needs to periodically refresh lightweight training data, perform maintenance cleanup when the device is idle/charging, and reliably download or update content even when the app is not in the foreground.

Quick Start

Follow the sections on Info.plist permitted identifiers, background mode capabilities, and the required task completion + expirationHandler patterns for each task type you plan to use.

Frequently Asked Questions about background-processing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I schedule and execute iOS background tasks using BGTaskScheduler?

iOS background task scheduling requires registering BGAppRefreshTask or BGProcessingTask identifiers in Info.plist under BGTaskSchedulerPermittedIdentifiers, enabling background modes, and calling setTaskCompleted(success:) on every execution path to prevent silent failures.

Why do my iOS background tasks fail silently or never run?

iOS background tasks fail silently when Info.plist lacks permitted identifiers, UIBackgroundModes are misconfigured, or setTaskCompleted(success:) is missing on an execution path, causing the system to terminate the task without warning.

How do I handle expirationHandler cancellation for background URLSession transfers?

Background URLSession transfers require implementing expirationHandler cancellation to stop work cleanly when the system time limit expires, and ensuring the completion handler relaunch behavior is configured correctly to resume interrupted downloads.

Can I use BGContinuedProcessingTask for long-running background work on iOS 26+?

BGContinuedProcessingTask on iOS 26+ supports long-running and continued background processing with progress reporting, allowing apps to perform maintenance tasks when idle or charging while maintaining expiration-safe execution guarantees.

Do I need to configure entitlements for silent push background fetches on iOS?

Silent background push fetches require configuring UIBackgroundModes with the remote-notification entitlement, registering the fetch task with BGTaskScheduler, and ensuring the completion handler is invoked promptly when content retrieval finishes.

What is the best way to guarantee task completion on all code paths for BGProcessingTask?

Guaranteeing BGProcessingTask completion requires wrapping execution in an expirationHandler that triggers cancellation, and placing setTaskCompleted(success:) in every return path, error branch, and finally block to satisfy iOS background task scheduling requirements.