[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6E65XDWD7TFMKBFQNHHSS7E":3,"skill-same:01M6E65XDWD7TFMKBFQNHHSS7E":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":33,"linkOnly":34,"markdownContent":35,"markdownBody":36,"frontMatter":37,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":45,"ownerHtmlUrl":46,"ownerBlogUrl":6,"ownerDescription":47,"updatedAt":48,"install":49,"resources":62},"01M6E65XDWD7TFMKBFQNHHSS7E","axiom-background-processing-ref",null,"Complete background task API reference - BGTaskScheduler, BGAppRefreshTask, BGProcessingTask, BGContinuedProcessingTask (iOS 26), beginBackgroundTask, background URLSession, with all WWDC code examples","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FCharlesWiltgen\u002FAxiom\u002Faxiom-background-processing-ref\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[24,25,26,27,28,29,30,31,32],"processing","axiom background processing ref","code","examples","ios","api","reference","task","complete","2026-11-10 10:12:30",false,"---\nname: axiom-background-processing-ref\ndescription: Complete background task API reference - BGTaskScheduler, BGAppRefreshTask, BGProcessingTask, BGContinuedProcessingTask (iOS 26), beginBackgroundTask, background URLSession, with all WWDC code examples\nlicense: MIT\nmetadata:\n  version: \"1.0.0\"\n---\n\n# Background Processing Reference\n\nComplete API reference for iOS background execution, with code examples from WWDC sessions.\n\n**Related skills**: `axiom-background-processing` (decision trees, patterns), `axiom-background-processing-diag` (troubleshooting)\n\n---\n\n## Part 1: BGTaskScheduler Registration\n\n### Info.plist Configuration\n\n```xml\n\u003C!-- Required: List all task identifiers -->\n\u003Ckey>BGTaskSchedulerPermittedIdentifiers\u003C\u002Fkey>\n\u003Carray>\n    \u003Cstring>com.yourapp.refresh\u003C\u002Fstring>\n    \u003Cstring>com.yourapp.maintenance\u003C\u002Fstring>\n    \u003C!-- Wildcard for dynamic identifiers (iOS 26+) -->\n    \u003Cstring>com.yourapp.export.*\u003C\u002Fstring>\n\u003C\u002Farray>\n\n\u003C!-- Required: Enable background modes -->\n\u003Ckey>UIBackgroundModes\u003C\u002Fkey>\n\u003Carray>\n    \u003C!-- For BGAppRefreshTask -->\n    \u003Cstring>fetch\u003C\u002Fstring>\n    \u003C!-- For BGProcessingTask -->\n    \u003Cstring>processing\u003C\u002Fstring>\n\u003C\u002Farray>\n```\n\n### Register Handler\n\n```swift\nimport BackgroundTasks\n\nfunc application(\n    _ application: UIApplication,\n    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?\n) -> Bool {\n\n    \u002F\u002F Register BEFORE returning from didFinishLaunching\n    BGTaskScheduler.shared.register(\n        forTaskWithIdentifier: \"com.yourapp.refresh\",\n        using: nil  \u002F\u002F nil = system creates serial background queue\n    ) { task in\n        self.handleAppRefresh(task: task as! BGAppRefreshTask)\n    }\n\n    BGTaskScheduler.shared.register(\n        forTaskWithIdentifier: \"com.yourapp.maintenance\",\n        using: nil\n    ) { task in\n        self.handleMaintenance(task: task as! BGProcessingTask)\n    }\n\n    return true\n}\n```\n\n**Parameters**:\n- `forTaskWithIdentifier`: Must match Info.plist exactly (case-sensitive)\n- `using`: DispatchQueue for handler callback; nil = system creates one\n- `launchHandler`: Called when task is launched; receives BGTask subclass\n\n### Registration Timing\n\nFrom WWDC 2019-707:\n> \"You do this by registering a launch handler **before your application finishes launching**\"\n\nRegister in:\n- ✅ `application(_:didFinishLaunchingWithOptions:)` before `return true`\n- ❌ Not in viewDidLoad, button handlers, or async callbacks\n\n---\n\n## Part 2: BGAppRefreshTask\n\n### Purpose\n\nKeep app content fresh throughout the day. System launches app based on **user usage patterns**.\n\n### Runtime\n\n~30 seconds (same as legacy background fetch)\n\n### Scheduling\n\n```swift\nfunc scheduleAppRefresh() {\n    let request = BGAppRefreshTaskRequest(identifier: \"com.yourapp.refresh\")\n\n    \u002F\u002F earliestBeginDate = MINIMUM delay (not exact time)\n    \u002F\u002F System decides actual time based on usage patterns\n    request.earliestBeginDate = Date(timeIntervalSinceNow: 15 * 60)\n\n    do {\n        try BGTaskScheduler.shared.submit(request)\n    } catch BGTaskScheduler.Error.notPermitted {\n        \u002F\u002F Background App Refresh disabled in Settings\n    } catch BGTaskScheduler.Error.tooManyPendingTaskRequests {\n        \u002F\u002F Too many pending requests for this identifier\n    } catch BGTaskScheduler.Error.unavailable {\n        \u002F\u002F Background tasks not available (Simulator, etc.)\n    } catch {\n        print(\"Schedule failed: \\(error)\")\n    }\n}\n\n\u002F\u002F Schedule when app enters background\nfunc applicationDidEnterBackground(_ application: UIApplication) {\n    scheduleAppRefresh()\n}\n```\n\n### Handler\n\n```swift\nfunc handleAppRefresh(task: BGAppRefreshTask) {\n    \u002F\u002F 1. Set expiration handler FIRST\n    task.expirationHandler = { [weak self] in\n        self?.currentOperation?.cancel()\n    }\n\n    \u002F\u002F 2. Schedule NEXT refresh (continuous pattern)\n    scheduleAppRefresh()\n\n    \u002F\u002F 3. Perform work\n    let operation = fetchLatestContentOperation()\n    currentOperation = operation\n\n    operation.completionBlock = {\n        \u002F\u002F 4. Signal completion (REQUIRED)\n        task.setTaskCompleted(success: !operation.isCancelled)\n    }\n\n    operationQueue.addOperation(operation)\n}\n```\n\n### BGAppRefreshTaskRequest Properties\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `identifier` | String | Must match Info.plist |\n| `earliestBeginDate` | Date? | Minimum delay before execution |\n\n---\n\n## Part 3: BGProcessingTask\n\n### Purpose\n\nDeferrable maintenance work (database cleanup, ML training, backups). Runs at **system-friendly times**, typically overnight when charging.\n\n### Runtime\n\nSeveral minutes (significantly longer than refresh tasks)\n\n### Scheduling with Constraints\n\n```swift\nfunc scheduleMaintenanceIfNeeded() {\n    \u002F\u002F Only schedule if work is needed\n    guard Date().timeIntervalSince(lastMaintenanceDate) > 7 * 24 * 3600 else {\n        return\n    }\n\n    let request = BGProcessingTaskRequest(identifier: \"com.yourapp.maintenance\")\n\n    \u002F\u002F CRITICAL for CPU-intensive work\n    request.requiresExternalPower = true\n\n    \u002F\u002F Optional: Need network for cloud sync\n    request.requiresNetworkConnectivity = true\n\n    \u002F\u002F Keep within 1 week — longer may be skipped\n    \u002F\u002F request.earliestBeginDate = ...\n\n    do {\n        try BGTaskScheduler.shared.submit(request)\n    } catch {\n        print(\"Schedule failed: \\(error)\")\n    }\n}\n```\n\n### Handler with Progress Checkpointing\n\n```swift\nfunc handleMaintenance(task: BGProcessingTask) {\n    var shouldContinue = true\n\n    task.expirationHandler = {\n        shouldContinue = false\n    }\n\n    Task {\n        for item in workItems {\n            guard shouldContinue else {\n                \u002F\u002F Expiration called — save progress and exit\n                saveProgress()\n                break\n            }\n\n            await processItem(item)\n            saveProgress()  \u002F\u002F Checkpoint after each item\n        }\n\n        task.setTaskCompleted(success: shouldContinue)\n    }\n}\n```\n\n### BGProcessingTaskRequest Properties\n\n| Property | Type | Default | Description |\n|----------|------|---------|-------------|\n| `identifier` | String | — | Must match Info.plist |\n| `earliestBeginDate` | Date? | nil | Minimum delay |\n| `requiresNetworkConnectivity` | Bool | false | Wait for network |\n| `requiresExternalPower` | Bool | false | Wait for charging |\n\n### CPU Monitor Disabling\n\n> \"For the first time ever, we're giving you the ability to turn that off for the duration of your processing task so you can take full advantage of the hardware while the device is plugged in.\"\n\nWhen `requiresExternalPower = true`, CPU Monitor (which normally terminates CPU-heavy background apps) is disabled.\n\n---\n\n## Part 4: BGContinuedProcessingTask (iOS 26+)\n\n### Purpose\n\nContinue **user-initiated work** after app backgrounds, with system UI showing progress. From WWDC 2025-227.\n\n**NOT for**: Automatic tasks, maintenance, syncing — user must explicitly initiate.\n\n### Use Cases\n\n- Photo\u002Fvideo export\n- Publishing content\n- Updating connected accessories\n- File compression\n\n### Info.plist (Wildcard Pattern)\n\n```xml\n\u003Ckey>BGTaskSchedulerPermittedIdentifiers\u003C\u002Fkey>\n\u003Carray>\n    \u003C!-- Wildcard for dynamic suffix -->\n    \u003Cstring>com.yourapp.export.*\u003C\u002Fstring>\n\u003C\u002Farray>\n```\n\n### Dynamic Registration\n\nUnlike other tasks, register **when user initiates action**:\n\n```swift\nfunc userTappedExportButton() {\n    \u002F\u002F Register dynamically\n    BGTaskScheduler.shared.register(\n        forTaskWithIdentifier: \"com.yourapp.export.photos\"\n    ) { task in\n        let continuedTask = task as! BGContinuedProcessingTask\n        self.handleExport(task: continuedTask)\n    }\n\n    \u002F\u002F Submit immediately\n    submitExportRequest()\n}\n```\n\n### Submission with Progress UI\n\n```swift\nfunc submitExportRequest() {\n    let request = BGContinuedProcessingTaskRequest(\n        identifier: \"com.yourapp.export.photos\",\n        title: \"Exporting Photos\",           \u002F\u002F Shown in system UI\n        subtitle: \"0 of 100 photos complete\"  \u002F\u002F Shown in system UI\n    )\n\n    \u002F\u002F Strategy: .fail = reject if can't start now; .enqueue = queue (default)\n    request.strategy = .fail\n\n    do {\n        try BGTaskScheduler.shared.submit(request)\n    } catch {\n        \u002F\u002F Show error — can't run in background now\n        showError(\"Cannot export in background right now\")\n    }\n}\n```\n\n### Handler with Mandatory Progress Reporting\n\n```swift\nfunc handleExport(task: BGContinuedProcessingTask) {\n    var shouldContinue = true\n\n    task.expirationHandler = {\n        shouldContinue = false\n    }\n\n    \u002F\u002F MANDATORY: Report progress\n    \u002F\u002F Tasks with no progress updates are AUTO-EXPIRED\n    task.progress.totalUnitCount = Int64(photos.count)\n    task.progress.completedUnitCount = 0\n\n    Task {\n        for (index, photo) in photos.enumerated() {\n            guard shouldContinue else { break }\n\n            await exportPhoto(photo)\n\n            \u002F\u002F Update progress — system displays to user\n            task.progress.completedUnitCount = Int64(index + 1)\n        }\n\n        task.setTaskCompleted(success: shouldContinue)\n    }\n}\n```\n\n### BGContinuedProcessingTaskRequest Properties\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `identifier` | String | With wildcard, can have dynamic suffix |\n| `title` | String | Shown in system progress UI |\n| `subtitle` | String | Shown in system progress UI |\n| `strategy` | Strategy | `.fail` or `.enqueue` (default) |\n\n### Strategy Options\n\n```swift\n\u002F\u002F .fail — Reject if can't start immediately\nrequest.strategy = .fail\n\n\u002F\u002F .enqueue — Queue if can't start (default)\n\u002F\u002F Task may run later\n```\n\n### GPU Access (iOS 26+)\n\n```swift\n\u002F\u002F Check if GPU available for background task\nlet supportedResources = BGTaskScheduler.shared.supportedResources\nif supportedResources.contains(.gpu) {\n    \u002F\u002F GPU is available\n}\n```\n\n---\n\n## Part 5: beginBackgroundTask\n\n### Purpose\n\nFinish critical work (~30 seconds) when app transitions to background. For state saving, completing uploads.\n\n### Basic Pattern\n\n```swift\nvar backgroundTaskID: UIBackgroundTaskIdentifier = .invalid\n\nfunc applicationDidEnterBackground(_ application: UIApplication) {\n    backgroundTaskID = application.beginBackgroundTask(withName: \"Save State\") {\n        \u002F\u002F Expiration handler — clean up immediately\n        self.saveProgress()\n        application.endBackgroundTask(self.backgroundTaskID)\n        self.backgroundTaskID = .invalid\n    }\n\n    \u002F\u002F Do critical work\n    saveEssentialState { [weak self] in\n        guard let self = self,\n              self.backgroundTaskID != .invalid else { return }\n\n        \u002F\u002F End task AS SOON AS work completes\n        UIApplication.shared.endBackgroundTask(self.backgroundTaskID)\n        self.backgroundTaskID = .invalid\n    }\n}\n```\n\n### Key Points\n\n- Call `endBackgroundTask` immediately when done — don't wait for expiration\n- Failing to end may cause system to terminate app\n- ~30 seconds max, not guaranteed\n- Use for finalization, not ongoing work\n\n### SwiftUI \u002F SceneDelegate\n\n```swift\n.onChange(of: scenePhase) { newPhase in\n    if newPhase == .background {\n        startBackgroundTask()\n    }\n}\n```\n\n---\n\n## Part 6: Background URLSession\n\n### Purpose\n\nLarge downloads\u002Fuploads that continue **even after app termination**. Work handed off to system daemon.\n\n### Configuration\n\n```swift\nlazy var backgroundSession: URLSession = {\n    let config = URLSessionConfiguration.background(\n        withIdentifier: \"com.yourapp.downloads\"\n    )\n\n    \u002F\u002F App relaunched when task completes\n    config.sessionSendsLaunchEvents = true\n\n    \u002F\u002F System chooses optimal time (WiFi, charging)\n    config.isDiscretionary = true\n\n    \u002F\u002F Timeout for requests (not the download itself)\n    config.timeoutIntervalForRequest = 60\n\n    return URLSession(configuration: config, delegate: self, delegateQueue: nil)\n}()\n```\n\n### Starting Download\n\n```swift\nfunc downloadFile(from url: URL) {\n    let task = backgroundSession.downloadTask(with: url)\n    task.resume()\n    \u002F\u002F Work continues even if app terminates\n}\n```\n\n### AppDelegate Handler\n\n```swift\nvar backgroundSessionCompletionHandler: (() -> Void)?\n\nfunc application(\n    _ application: UIApplication,\n    handleEventsForBackgroundURLSession identifier: String,\n    completionHandler: @escaping () -> Void\n) {\n    \u002F\u002F Store — call after all events processed\n    backgroundSessionCompletionHandler = completionHandler\n}\n```\n\n### URLSessionDelegate Implementation\n\n```swift\nextension AppDelegate: URLSessionDelegate, URLSessionDownloadDelegate {\n\n    func urlSession(\n        _ session: URLSession,\n        downloadTask: URLSessionDownloadTask,\n        didFinishDownloadingTo location: URL\n    ) {\n        \u002F\u002F MUST move file immediately — temp location deleted after return\n        let destination = getDestinationURL(for: downloadTask)\n        try? FileManager.default.moveItem(at: location, to: destination)\n    }\n\n    func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) {\n        \u002F\u002F All events processed — call stored completion handler\n        DispatchQueue.main.async {\n            self.backgroundSessionCompletionHandler?()\n            self.backgroundSessionCompletionHandler = nil\n        }\n    }\n}\n```\n\n### Configuration Properties\n\n| Property | Default | Description |\n|----------|---------|-------------|\n| `sessionSendsLaunchEvents` | false | Relaunch app on completion |\n| `isDiscretionary` | false | Wait for optimal conditions |\n| `allowsCellularAccess` | true | Allow cellular network |\n| `allowsExpensiveNetworkAccess` | true | Allow expensive networks |\n| `allowsConstrainedNetworkAccess` | true | Allow Low Data Mode |\n\n---\n\n## Part 7: Testing Background Tasks\n\n### LLDB Debugging Commands\n\nPause app in debugger, then execute:\n\n```lldb\n\u002F\u002F Trigger task launch\ne -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateLaunchForTaskWithIdentifier:@\"com.yourapp.refresh\"]\n\n\u002F\u002F Trigger task expiration\ne -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateExpirationForTaskWithIdentifier:@\"com.yourapp.refresh\"]\n```\n\n### Testing Workflow\n\n1. Set breakpoint in task handler\n2. Run app, let it enter background\n3. Pause execution (Debug → Pause)\n4. Execute simulate launch command\n5. Resume — breakpoint should hit\n6. Test expiration handling with simulate expiration\n\n### Console Logging\n\nFilter Console.app:\n\n```\nsubsystem:com.apple.backgroundtaskscheduler\n```\n\n### getPendingTaskRequests\n\nCheck what's scheduled:\n\n```swift\nBGTaskScheduler.shared.getPendingTaskRequests { requests in\n    for request in requests {\n        print(\"Pending: \\(request.identifier)\")\n        print(\"  Earliest: \\(request.earliestBeginDate ?? Date())\")\n    }\n}\n```\n\n---\n\n## Part 8: Throttling & System Constraints\n\n### The 7 Scheduling Factors\n\n| Factor | How to Check | Impact |\n|--------|--------------|--------|\n| Critically Low Battery | Battery \u003C ~20% | Discretionary work paused |\n| Low Power Mode | `ProcessInfo.isLowPowerModeEnabled` | Limited activity |\n| App Usage | User opens app frequently? | Higher priority |\n| App Switcher | Not swiped away? | Swiped = no background |\n| Background App Refresh | `backgroundRefreshStatus` | Off = no BGAppRefresh |\n| System Budgets | Many recent launches? | Budget depletes, refills daily |\n| Rate Limiting | Requests too frequent? | System spaces launches |\n\n### Checking Constraints\n\n```swift\n\u002F\u002F Low Power Mode\nif ProcessInfo.processInfo.isLowPowerModeEnabled {\n    \u002F\u002F Reduce background work\n}\n\n\u002F\u002F Listen for changes\nNotificationCenter.default.publisher(for: .NSProcessInfoPowerStateDidChange)\n    .sink { _ in\n        \u002F\u002F Adapt behavior\n    }\n\n\u002F\u002F Background App Refresh status\nswitch UIApplication.shared.backgroundRefreshStatus {\ncase .available:\n    \u002F\u002F Can schedule tasks\ncase .denied:\n    \u002F\u002F User disabled — prompt in Settings\ncase .restricted:\n    \u002F\u002F MDM or parental controls — cannot enable\n@unknown default:\n    break\n}\n```\n\n### Thermal State\n\n```swift\nswitch ProcessInfo.processInfo.thermalState {\ncase .nominal:\n    break  \u002F\u002F Normal operation\ncase .fair:\n    \u002F\u002F Reduce intensive work\ncase .serious:\n    \u002F\u002F Minimize all background activity\ncase .critical:\n    \u002F\u002F Stop non-essential work immediately\n@unknown default:\n    break\n}\n\nNotificationCenter.default.publisher(for: ProcessInfo.thermalStateDidChangeNotification)\n    .sink { _ in\n        \u002F\u002F Respond to thermal changes\n    }\n```\n\n---\n\n## Part 9: Push Notifications for Background\n\n### Silent Push Payload\n\n```json\n{\n    \"aps\": {\n        \"content-available\": 1\n    },\n    \"custom-data\": \"your-payload\"\n}\n```\n\n### APNS Priority\n\n```\napns-priority: 5   \u002F\u002F Discretionary — energy efficient (recommended)\napns-priority: 10  \u002F\u002F Immediate — only for time-sensitive\n```\n\n### Handler\n\n```swift\nfunc application(\n    _ application: UIApplication,\n    didReceiveRemoteNotification userInfo: [AnyHashable: Any],\n    fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void\n) {\n    guard userInfo[\"aps\"] as? [String: Any] != nil else {\n        completionHandler(.noData)\n        return\n    }\n\n    Task {\n        do {\n            let hasNewData = try await fetchLatestData()\n            completionHandler(hasNewData ? .newData : .noData)\n        } catch {\n            completionHandler(.failed)\n        }\n    }\n}\n```\n\n### Rate Limiting Behavior\n\n> \"Receiving 14 pushes in a window may result in only 7 launches, maintaining a ~15-minute interval.\"\n\nSilent pushes are rate-limited. Don't expect launch on every push.\n\n---\n\n## Part 10: SwiftUI Integration\n\n### backgroundTask Modifier\n\n```swift\n@main\nstruct MyApp: App {\n    @Environment(\\.scenePhase) var scenePhase\n\n    var body: some Scene {\n        WindowGroup {\n            ContentView()\n        }\n        .onChange(of: scenePhase) { newPhase in\n            if newPhase == .background {\n                scheduleAppRefresh()\n            }\n        }\n        \u002F\u002F App refresh handler\n        .backgroundTask(.appRefresh(\"com.yourapp.refresh\")) {\n            scheduleAppRefresh()  \u002F\u002F Schedule next\n            await fetchLatestContent()\n            \u002F\u002F Task completes when closure returns (no setTaskCompleted needed)\n        }\n        \u002F\u002F Background URLSession handler\n        .backgroundTask(.urlSession(\"com.yourapp.downloads\")) {\n            await processDownloadedFiles()\n        }\n    }\n}\n```\n\n### Cancellation with Swift Concurrency\n\n```swift\n.backgroundTask(.appRefresh(\"com.yourapp.refresh\")) {\n    await withTaskCancellationHandler {\n        \u002F\u002F Normal work\n        try await fetchData()\n    } onCancel: {\n        \u002F\u002F Called when task expires\n        \u002F\u002F Keep lightweight — runs synchronously\n    }\n}\n```\n\n### Background URLSession with SwiftUI\n\n```swift\n.backgroundTask(.urlSession(\"com.yourapp.weather\")) {\n    \u002F\u002F Called when background URLSession completes\n    \u002F\u002F Handle completed downloads\n}\n```\n\n---\n\n## Quick Reference\n\n### Task Types\n\n| Type | Runtime | API | Use Case |\n|------|---------|-----|----------|\n| BGAppRefreshTask | ~30s | submit(BGAppRefreshTaskRequest) | Fresh content |\n| BGProcessingTask | Minutes | submit(BGProcessingTaskRequest) | Maintenance |\n| BGContinuedProcessingTask | Extended | submit(BGContinuedProcessingTaskRequest) | User-initiated |\n| beginBackgroundTask | ~30s | beginBackgroundTask(withName:) | State saving |\n| Background URLSession | As needed | URLSessionConfiguration.background | Downloads |\n| Silent Push | ~30s | didReceiveRemoteNotification | Server trigger |\n\n### Required Info.plist\n\n```xml\n\u003Ckey>BGTaskSchedulerPermittedIdentifiers\u003C\u002Fkey>\n\u003Carray>\n    \u003Cstring>your.identifiers.here\u003C\u002Fstring>\n\u003C\u002Farray>\n\n\u003Ckey>UIBackgroundModes\u003C\u002Fkey>\n\u003Carray>\n    \u003Cstring>fetch\u003C\u002Fstring>      \u003C!-- BGAppRefreshTask -->\n    \u003Cstring>processing\u003C\u002Fstring> \u003C!-- BGProcessingTask -->\n\u003C\u002Farray>\n```\n\n### LLDB Commands\n\n```lldb\n\u002F\u002F Launch\ne -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateLaunchForTaskWithIdentifier:@\"ID\"]\n\n\u002F\u002F Expire\ne -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateExpirationForTaskWithIdentifier:@\"ID\"]\n```\n\n---\n\n## Resources\n\n**WWDC**: 2019-707, 2020-10063, 2022-10142, 2023-10170, 2025-227\n\n**Docs**: \u002Fbackgroundtasks, \u002Fbackgroundtasks\u002Fbgtaskscheduler, \u002Ffoundation\u002Furlsessionconfiguration\n\n**Skills**: axiom-background-processing, axiom-background-processing-diag\n\n---\n\n**Last Updated**: 2025-12-31\n**Platforms**: iOS 13+, iOS 26+ (BGContinuedProcessingTask)\n\n","# Background Processing Reference\n\nComplete API reference for iOS background execution, with code examples from WWDC sessions.\n\n**Related skills**: `axiom-background-processing` (decision trees, patterns), `axiom-background-processing-diag` (troubleshooting)\n\n---\n\n## Part 1: BGTaskScheduler Registration\n\n### Info.plist Configuration\n\n```xml\n\u003C!-- Required: List all task identifiers -->\n\u003Ckey>BGTaskSchedulerPermittedIdentifiers\u003C\u002Fkey>\n\u003Carray>\n    \u003Cstring>com.yourapp.refresh\u003C\u002Fstring>\n    \u003Cstring>com.yourapp.maintenance\u003C\u002Fstring>\n    \u003C!-- Wildcard for dynamic identifiers (iOS 26+) -->\n    \u003Cstring>com.yourapp.export.*\u003C\u002Fstring>\n\u003C\u002Farray>\n\n\u003C!-- Required: Enable background modes -->\n\u003Ckey>UIBackgroundModes\u003C\u002Fkey>\n\u003Carray>\n    \u003C!-- For BGAppRefreshTask -->\n    \u003Cstring>fetch\u003C\u002Fstring>\n    \u003C!-- For BGProcessingTask -->\n    \u003Cstring>processing\u003C\u002Fstring>\n\u003C\u002Farray>\n```\n\n### Register Handler\n\n```swift\nimport BackgroundTasks\n\nfunc application(\n    _ application: UIApplication,\n    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?\n) -> Bool {\n\n    \u002F\u002F Register BEFORE returning from didFinishLaunching\n    BGTaskScheduler.shared.register(\n        forTaskWithIdentifier: \"com.yourapp.refresh\",\n        using: nil  \u002F\u002F nil = system creates serial background queue\n    ) { task in\n        self.handleAppRefresh(task: task as! BGAppRefreshTask)\n    }\n\n    BGTaskScheduler.shared.register(\n        forTaskWithIdentifier: \"com.yourapp.maintenance\",\n        using: nil\n    ) { task in\n        self.handleMaintenance(task: task as! BGProcessingTask)\n    }\n\n    return true\n}\n```\n\n**Parameters**:\n- `forTaskWithIdentifier`: Must match Info.plist exactly (case-sensitive)\n- `using`: DispatchQueue for handler callback; nil = system creates one\n- `launchHandler`: Called when task is launched; receives BGTask subclass\n\n### Registration Timing\n\nFrom WWDC 2019-707:\n> \"You do this by registering a launch handler **before your application finishes launching**\"\n\nRegister in:\n- ✅ `application(_:didFinishLaunchingWithOptions:)` before `return true`\n- ❌ Not in viewDidLoad, button handlers, or async callbacks\n\n---\n\n## Part 2: BGAppRefreshTask\n\n### Purpose\n\nKeep app content fresh throughout the day. System launches app based on **user usage patterns**.\n\n### Runtime\n\n~30 seconds (same as legacy background fetch)\n\n### Scheduling\n\n```swift\nfunc scheduleAppRefresh() {\n    let request = BGAppRefreshTaskRequest(identifier: \"com.yourapp.refresh\")\n\n    \u002F\u002F earliestBeginDate = MINIMUM delay (not exact time)\n    \u002F\u002F System decides actual time based on usage patterns\n    request.earliestBeginDate = Date(timeIntervalSinceNow: 15 * 60)\n\n    do {\n        try BGTaskScheduler.shared.submit(request)\n    } catch BGTaskScheduler.Error.notPermitted {\n        \u002F\u002F Background App Refresh disabled in Settings\n    } catch BGTaskScheduler.Error.tooManyPendingTaskRequests {\n        \u002F\u002F Too many pending requests for this identifier\n    } catch BGTaskScheduler.Error.unavailable {\n        \u002F\u002F Background tasks not available (Simulator, etc.)\n    } catch {\n        print(\"Schedule failed: \\(error)\")\n    }\n}\n\n\u002F\u002F Schedule when app enters background\nfunc applicationDidEnterBackground(_ application: UIApplication) {\n    scheduleAppRefresh()\n}\n```\n\n### Handler\n\n```swift\nfunc handleAppRefresh(task: BGAppRefreshTask) {\n    \u002F\u002F 1. Set expiration handler FIRST\n    task.expirationHandler = { [weak self] in\n        self?.currentOperation?.cancel()\n    }\n\n    \u002F\u002F 2. Schedule NEXT refresh (continuous pattern)\n    scheduleAppRefresh()\n\n    \u002F\u002F 3. Perform work\n    let operation = fetchLatestContentOperation()\n    currentOperation = operation\n\n    operation.completionBlock = {\n        \u002F\u002F 4. Signal completion (REQUIRED)\n        task.setTaskCompleted(success: !operation.isCancelled)\n    }\n\n    operationQueue.addOperation(operation)\n}\n```\n\n### BGAppRefreshTaskRequest Properties\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `identifier` | String | Must match Info.plist |\n| `earliestBeginDate` | Date? | Minimum delay before execution |\n\n---\n\n## Part 3: BGProcessingTask\n\n### Purpose\n\nDeferrable maintenance work (database cleanup, ML training, backups). Runs at **system-friendly times**, typically overnight when charging.\n\n### Runtime\n\nSeveral minutes (significantly longer than refresh tasks)\n\n### Scheduling with Constraints\n\n```swift\nfunc scheduleMaintenanceIfNeeded() {\n    \u002F\u002F Only schedule if work is needed\n    guard Date().timeIntervalSince(lastMaintenanceDate) > 7 * 24 * 3600 else {\n        return\n    }\n\n    let request = BGProcessingTaskRequest(identifier: \"com.yourapp.maintenance\")\n\n    \u002F\u002F CRITICAL for CPU-intensive work\n    request.requiresExternalPower = true\n\n    \u002F\u002F Optional: Need network for cloud sync\n    request.requiresNetworkConnectivity = true\n\n    \u002F\u002F Keep within 1 week — longer may be skipped\n    \u002F\u002F request.earliestBeginDate = ...\n\n    do {\n        try BGTaskScheduler.shared.submit(request)\n    } catch {\n        print(\"Schedule failed: \\(error)\")\n    }\n}\n```\n\n### Handler with Progress Checkpointing\n\n```swift\nfunc handleMaintenance(task: BGProcessingTask) {\n    var shouldContinue = true\n\n    task.expirationHandler = {\n        shouldContinue = false\n    }\n\n    Task {\n        for item in workItems {\n            guard shouldContinue else {\n                \u002F\u002F Expiration called — save progress and exit\n                saveProgress()\n                break\n            }\n\n            await processItem(item)\n            saveProgress()  \u002F\u002F Checkpoint after each item\n        }\n\n        task.setTaskCompleted(success: shouldContinue)\n    }\n}\n```\n\n### BGProcessingTaskRequest Properties\n\n| Property | Type | Default | Description |\n|----------|------|---------|-------------|\n| `identifier` | String | — | Must match Info.plist |\n| `earliestBeginDate` | Date? | nil | Minimum delay |\n| `requiresNetworkConnectivity` | Bool | false | Wait for network |\n| `requiresExternalPower` | Bool | false | Wait for charging |\n\n### CPU Monitor Disabling\n\n> \"For the first time ever, we're giving you the ability to turn that off for the duration of your processing task so you can take full advantage of the hardware while the device is plugged in.\"\n\nWhen `requiresExternalPower = true`, CPU Monitor (which normally terminates CPU-heavy background apps) is disabled.\n\n---\n\n## Part 4: BGContinuedProcessingTask (iOS 26+)\n\n### Purpose\n\nContinue **user-initiated work** after app backgrounds, with system UI showing progress. From WWDC 2025-227.\n\n**NOT for**: Automatic tasks, maintenance, syncing — user must explicitly initiate.\n\n### Use Cases\n\n- Photo\u002Fvideo export\n- Publishing content\n- Updating connected accessories\n- File compression\n\n### Info.plist (Wildcard Pattern)\n\n```xml\n\u003Ckey>BGTaskSchedulerPermittedIdentifiers\u003C\u002Fkey>\n\u003Carray>\n    \u003C!-- Wildcard for dynamic suffix -->\n    \u003Cstring>com.yourapp.export.*\u003C\u002Fstring>\n\u003C\u002Farray>\n```\n\n### Dynamic Registration\n\nUnlike other tasks, register **when user initiates action**:\n\n```swift\nfunc userTappedExportButton() {\n    \u002F\u002F Register dynamically\n    BGTaskScheduler.shared.register(\n        forTaskWithIdentifier: \"com.yourapp.export.photos\"\n    ) { task in\n        let continuedTask = task as! BGContinuedProcessingTask\n        self.handleExport(task: continuedTask)\n    }\n\n    \u002F\u002F Submit immediately\n    submitExportRequest()\n}\n```\n\n### Submission with Progress UI\n\n```swift\nfunc submitExportRequest() {\n    let request = BGContinuedProcessingTaskRequest(\n        identifier: \"com.yourapp.export.photos\",\n        title: \"Exporting Photos\",           \u002F\u002F Shown in system UI\n        subtitle: \"0 of 100 photos complete\"  \u002F\u002F Shown in system UI\n    )\n\n    \u002F\u002F Strategy: .fail = reject if can't start now; .enqueue = queue (default)\n    request.strategy = .fail\n\n    do {\n        try BGTaskScheduler.shared.submit(request)\n    } catch {\n        \u002F\u002F Show error — can't run in background now\n        showError(\"Cannot export in background right now\")\n    }\n}\n```\n\n### Handler with Mandatory Progress Reporting\n\n```swift\nfunc handleExport(task: BGContinuedProcessingTask) {\n    var shouldContinue = true\n\n    task.expirationHandler = {\n        shouldContinue = false\n    }\n\n    \u002F\u002F MANDATORY: Report progress\n    \u002F\u002F Tasks with no progress updates are AUTO-EXPIRED\n    task.progress.totalUnitCount = Int64(photos.count)\n    task.progress.completedUnitCount = 0\n\n    Task {\n        for (index, photo) in photos.enumerated() {\n            guard shouldContinue else { break }\n\n            await exportPhoto(photo)\n\n            \u002F\u002F Update progress — system displays to user\n            task.progress.completedUnitCount = Int64(index + 1)\n        }\n\n        task.setTaskCompleted(success: shouldContinue)\n    }\n}\n```\n\n### BGContinuedProcessingTaskRequest Properties\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `identifier` | String | With wildcard, can have dynamic suffix |\n| `title` | String | Shown in system progress UI |\n| `subtitle` | String | Shown in system progress UI |\n| `strategy` | Strategy | `.fail` or `.enqueue` (default) |\n\n### Strategy Options\n\n```swift\n\u002F\u002F .fail — Reject if can't start immediately\nrequest.strategy = .fail\n\n\u002F\u002F .enqueue — Queue if can't start (default)\n\u002F\u002F Task may run later\n```\n\n### GPU Access (iOS 26+)\n\n```swift\n\u002F\u002F Check if GPU available for background task\nlet supportedResources = BGTaskScheduler.shared.supportedResources\nif supportedResources.contains(.gpu) {\n    \u002F\u002F GPU is available\n}\n```\n\n---\n\n## Part 5: beginBackgroundTask\n\n### Purpose\n\nFinish critical work (~30 seconds) when app transitions to background. For state saving, completing uploads.\n\n### Basic Pattern\n\n```swift\nvar backgroundTaskID: UIBackgroundTaskIdentifier = .invalid\n\nfunc applicationDidEnterBackground(_ application: UIApplication) {\n    backgroundTaskID = application.beginBackgroundTask(withName: \"Save State\") {\n        \u002F\u002F Expiration handler — clean up immediately\n        self.saveProgress()\n        application.endBackgroundTask(self.backgroundTaskID)\n        self.backgroundTaskID = .invalid\n    }\n\n    \u002F\u002F Do critical work\n    saveEssentialState { [weak self] in\n        guard let self = self,\n              self.backgroundTaskID != .invalid else { return }\n\n        \u002F\u002F End task AS SOON AS work completes\n        UIApplication.shared.endBackgroundTask(self.backgroundTaskID)\n        self.backgroundTaskID = .invalid\n    }\n}\n```\n\n### Key Points\n\n- Call `endBackgroundTask` immediately when done — don't wait for expiration\n- Failing to end may cause system to terminate app\n- ~30 seconds max, not guaranteed\n- Use for finalization, not ongoing work\n\n### SwiftUI \u002F SceneDelegate\n\n```swift\n.onChange(of: scenePhase) { newPhase in\n    if newPhase == .background {\n        startBackgroundTask()\n    }\n}\n```\n\n---\n\n## Part 6: Background URLSession\n\n### Purpose\n\nLarge downloads\u002Fuploads that continue **even after app termination**. Work handed off to system daemon.\n\n### Configuration\n\n```swift\nlazy var backgroundSession: URLSession = {\n    let config = URLSessionConfiguration.background(\n        withIdentifier: \"com.yourapp.downloads\"\n    )\n\n    \u002F\u002F App relaunched when task completes\n    config.sessionSendsLaunchEvents = true\n\n    \u002F\u002F System chooses optimal time (WiFi, charging)\n    config.isDiscretionary = true\n\n    \u002F\u002F Timeout for requests (not the download itself)\n    config.timeoutIntervalForRequest = 60\n\n    return URLSession(configuration: config, delegate: self, delegateQueue: nil)\n}()\n```\n\n### Starting Download\n\n```swift\nfunc downloadFile(from url: URL) {\n    let task = backgroundSession.downloadTask(with: url)\n    task.resume()\n    \u002F\u002F Work continues even if app terminates\n}\n```\n\n### AppDelegate Handler\n\n```swift\nvar backgroundSessionCompletionHandler: (() -> Void)?\n\nfunc application(\n    _ application: UIApplication,\n    handleEventsForBackgroundURLSession identifier: String,\n    completionHandler: @escaping () -> Void\n) {\n    \u002F\u002F Store — call after all events processed\n    backgroundSessionCompletionHandler = completionHandler\n}\n```\n\n### URLSessionDelegate Implementation\n\n```swift\nextension AppDelegate: URLSessionDelegate, URLSessionDownloadDelegate {\n\n    func urlSession(\n        _ session: URLSession,\n        downloadTask: URLSessionDownloadTask,\n        didFinishDownloadingTo location: URL\n    ) {\n        \u002F\u002F MUST move file immediately — temp location deleted after return\n        let destination = getDestinationURL(for: downloadTask)\n        try? FileManager.default.moveItem(at: location, to: destination)\n    }\n\n    func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) {\n        \u002F\u002F All events processed — call stored completion handler\n        DispatchQueue.main.async {\n            self.backgroundSessionCompletionHandler?()\n            self.backgroundSessionCompletionHandler = nil\n        }\n    }\n}\n```\n\n### Configuration Properties\n\n| Property | Default | Description |\n|----------|---------|-------------|\n| `sessionSendsLaunchEvents` | false | Relaunch app on completion |\n| `isDiscretionary` | false | Wait for optimal conditions |\n| `allowsCellularAccess` | true | Allow cellular network |\n| `allowsExpensiveNetworkAccess` | true | Allow expensive networks |\n| `allowsConstrainedNetworkAccess` | true | Allow Low Data Mode |\n\n---\n\n## Part 7: Testing Background Tasks\n\n### LLDB Debugging Commands\n\nPause app in debugger, then execute:\n\n```lldb\n\u002F\u002F Trigger task launch\ne -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateLaunchForTaskWithIdentifier:@\"com.yourapp.refresh\"]\n\n\u002F\u002F Trigger task expiration\ne -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateExpirationForTaskWithIdentifier:@\"com.yourapp.refresh\"]\n```\n\n### Testing Workflow\n\n1. Set breakpoint in task handler\n2. Run app, let it enter background\n3. Pause execution (Debug → Pause)\n4. Execute simulate launch command\n5. Resume — breakpoint should hit\n6. Test expiration handling with simulate expiration\n\n### Console Logging\n\nFilter Console.app:\n\n```\nsubsystem:com.apple.backgroundtaskscheduler\n```\n\n### getPendingTaskRequests\n\nCheck what's scheduled:\n\n```swift\nBGTaskScheduler.shared.getPendingTaskRequests { requests in\n    for request in requests {\n        print(\"Pending: \\(request.identifier)\")\n        print(\"  Earliest: \\(request.earliestBeginDate ?? Date())\")\n    }\n}\n```\n\n---\n\n## Part 8: Throttling & System Constraints\n\n### The 7 Scheduling Factors\n\n| Factor | How to Check | Impact |\n|--------|--------------|--------|\n| Critically Low Battery | Battery \u003C ~20% | Discretionary work paused |\n| Low Power Mode | `ProcessInfo.isLowPowerModeEnabled` | Limited activity |\n| App Usage | User opens app frequently? | Higher priority |\n| App Switcher | Not swiped away? | Swiped = no background |\n| Background App Refresh | `backgroundRefreshStatus` | Off = no BGAppRefresh |\n| System Budgets | Many recent launches? | Budget depletes, refills daily |\n| Rate Limiting | Requests too frequent? | System spaces launches |\n\n### Checking Constraints\n\n```swift\n\u002F\u002F Low Power Mode\nif ProcessInfo.processInfo.isLowPowerModeEnabled {\n    \u002F\u002F Reduce background work\n}\n\n\u002F\u002F Listen for changes\nNotificationCenter.default.publisher(for: .NSProcessInfoPowerStateDidChange)\n    .sink { _ in\n        \u002F\u002F Adapt behavior\n    }\n\n\u002F\u002F Background App Refresh status\nswitch UIApplication.shared.backgroundRefreshStatus {\ncase .available:\n    \u002F\u002F Can schedule tasks\ncase .denied:\n    \u002F\u002F User disabled — prompt in Settings\ncase .restricted:\n    \u002F\u002F MDM or parental controls — cannot enable\n@unknown default:\n    break\n}\n```\n\n### Thermal State\n\n```swift\nswitch ProcessInfo.processInfo.thermalState {\ncase .nominal:\n    break  \u002F\u002F Normal operation\ncase .fair:\n    \u002F\u002F Reduce intensive work\ncase .serious:\n    \u002F\u002F Minimize all background activity\ncase .critical:\n    \u002F\u002F Stop non-essential work immediately\n@unknown default:\n    break\n}\n\nNotificationCenter.default.publisher(for: ProcessInfo.thermalStateDidChangeNotification)\n    .sink { _ in\n        \u002F\u002F Respond to thermal changes\n    }\n```\n\n---\n\n## Part 9: Push Notifications for Background\n\n### Silent Push Payload\n\n```json\n{\n    \"aps\": {\n        \"content-available\": 1\n    },\n    \"custom-data\": \"your-payload\"\n}\n```\n\n### APNS Priority\n\n```\napns-priority: 5   \u002F\u002F Discretionary — energy efficient (recommended)\napns-priority: 10  \u002F\u002F Immediate — only for time-sensitive\n```\n\n### Handler\n\n```swift\nfunc application(\n    _ application: UIApplication,\n    didReceiveRemoteNotification userInfo: [AnyHashable: Any],\n    fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void\n) {\n    guard userInfo[\"aps\"] as? [String: Any] != nil else {\n        completionHandler(.noData)\n        return\n    }\n\n    Task {\n        do {\n            let hasNewData = try await fetchLatestData()\n            completionHandler(hasNewData ? .newData : .noData)\n        } catch {\n            completionHandler(.failed)\n        }\n    }\n}\n```\n\n### Rate Limiting Behavior\n\n> \"Receiving 14 pushes in a window may result in only 7 launches, maintaining a ~15-minute interval.\"\n\nSilent pushes are rate-limited. Don't expect launch on every push.\n\n---\n\n## Part 10: SwiftUI Integration\n\n### backgroundTask Modifier\n\n```swift\n@main\nstruct MyApp: App {\n    @Environment(\\.scenePhase) var scenePhase\n\n    var body: some Scene {\n        WindowGroup {\n            ContentView()\n        }\n        .onChange(of: scenePhase) { newPhase in\n            if newPhase == .background {\n                scheduleAppRefresh()\n            }\n        }\n        \u002F\u002F App refresh handler\n        .backgroundTask(.appRefresh(\"com.yourapp.refresh\")) {\n            scheduleAppRefresh()  \u002F\u002F Schedule next\n            await fetchLatestContent()\n            \u002F\u002F Task completes when closure returns (no setTaskCompleted needed)\n        }\n        \u002F\u002F Background URLSession handler\n        .backgroundTask(.urlSession(\"com.yourapp.downloads\")) {\n            await processDownloadedFiles()\n        }\n    }\n}\n```\n\n### Cancellation with Swift Concurrency\n\n```swift\n.backgroundTask(.appRefresh(\"com.yourapp.refresh\")) {\n    await withTaskCancellationHandler {\n        \u002F\u002F Normal work\n        try await fetchData()\n    } onCancel: {\n        \u002F\u002F Called when task expires\n        \u002F\u002F Keep lightweight — runs synchronously\n    }\n}\n```\n\n### Background URLSession with SwiftUI\n\n```swift\n.backgroundTask(.urlSession(\"com.yourapp.weather\")) {\n    \u002F\u002F Called when background URLSession completes\n    \u002F\u002F Handle completed downloads\n}\n```\n\n---\n\n## Quick Reference\n\n### Task Types\n\n| Type | Runtime | API | Use Case |\n|------|---------|-----|----------|\n| BGAppRefreshTask | ~30s | submit(BGAppRefreshTaskRequest) | Fresh content |\n| BGProcessingTask | Minutes | submit(BGProcessingTaskRequest) | Maintenance |\n| BGContinuedProcessingTask | Extended | submit(BGContinuedProcessingTaskRequest) | User-initiated |\n| beginBackgroundTask | ~30s | beginBackgroundTask(withName:) | State saving |\n| Background URLSession | As needed | URLSessionConfiguration.background | Downloads |\n| Silent Push | ~30s | didReceiveRemoteNotification | Server trigger |\n\n### Required Info.plist\n\n```xml\n\u003Ckey>BGTaskSchedulerPermittedIdentifiers\u003C\u002Fkey>\n\u003Carray>\n    \u003Cstring>your.identifiers.here\u003C\u002Fstring>\n\u003C\u002Farray>\n\n\u003Ckey>UIBackgroundModes\u003C\u002Fkey>\n\u003Carray>\n    \u003Cstring>fetch\u003C\u002Fstring>      \u003C!-- BGAppRefreshTask -->\n    \u003Cstring>processing\u003C\u002Fstring> \u003C!-- BGProcessingTask -->\n\u003C\u002Farray>\n```\n\n### LLDB Commands\n\n```lldb\n\u002F\u002F Launch\ne -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateLaunchForTaskWithIdentifier:@\"ID\"]\n\n\u002F\u002F Expire\ne -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateExpirationForTaskWithIdentifier:@\"ID\"]\n```\n\n---\n\n## Resources\n\n**WWDC**: 2019-707, 2020-10063, 2022-10142, 2023-10170, 2025-227\n\n**Docs**: \u002Fbackgroundtasks, \u002Fbackgroundtasks\u002Fbgtaskscheduler, \u002Ffoundation\u002Furlsessionconfiguration\n\n**Skills**: axiom-background-processing, axiom-background-processing-diag\n\n---\n\n**Last Updated**: 2025-12-31\n**Platforms**: iOS 13+, iOS 26+ (BGContinuedProcessingTask)\n\n",{"name":5,"license":15,"metadata":38,"description":7},{"version":39},"1.0.0","main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FCharlesWiltgen\u002FAxiom\u002Faxiom-background-processing-ref",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill axiom-background-processing-ref",{"tool":55,"command":56},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill axiom-background-processing-ref",{"tool":58,"command":59},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill axiom-background-processing-ref","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FCharlesWiltgen\u002FAxiom\u002Faxiom-background-processing-ref\u002FSKILL.md",true,[63],{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Fscenario-templates.md","REFERENCE","参考文档",4150,"https:\u002F\u002Fgithub.com\u002Fagency-black\u002FSkills\u002Fblob\u002Fmain\u002Fwhat-if-oracle\u002Freferences\u002Fscenario-templates.md",[70,84,94,103,109,116],{"skillNo":71,"name":72,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":80,"publishedAt":33},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[75],{"categoryNo":76,"categoryName":77,"taxonomyType":78,"taxonomyTypeDesc":79},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[81,82,83],"model","model hierarchy","model hierarchy skill",{"skillNo":85,"name":86,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":90,"publishedAt":33},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[89],{"categoryNo":76,"categoryName":77,"taxonomyType":78,"taxonomyTypeDesc":79},[91,92,93],"MCP","zoom","zoom mcp",{"skillNo":95,"name":96,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":33},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[100,101,102,92],"sdk","zoom apps sdk","apps",{"skillNo":104,"name":105,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":33},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[105],{"skillNo":110,"name":111,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":115,"publishedAt":33},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[114],{"categoryNo":76,"categoryName":77,"taxonomyType":78,"taxonomyTypeDesc":79},[111],{"skillNo":117,"name":118,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":33},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[118]]