IOSKmpWorker
class IOSKmpWorker(eventStore: EventStore? = null, chainRepo: ChainRepository? = null, telemetry: TelemetryCollector? = null) : KmpWorker
iOS concrete implementation of KmpWorker.
Required startup: Call initialize from your AppDelegate BEFORE the app finishes launching. This registers all task identifiers with BGTaskScheduler.
// AppDelegate.swift
let kmpWorker = IOSKmpWorker()
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
kmpWorker.initialize()
return true
}
// Required for NSURLSession background downloads to survive termination:
func application(
_ application: UIApplication,
handleEventsForBackgroundURLSession identifier: String,
completionHandler: @escaping () -> Void
) {
IOSBackgroundDownloadWorker.handleBackgroundSession(
identifier: identifier,
completionHandler: completionHandler
)
}Content copied to clipboard
Parameters
eventStore
Optional. Install to persist terminal events for cold-launch replay.
chainRepo
Optional. Required for enqueueChain support.
⚠️ See docs/ios-limitations.md for BGTaskScheduler execution constraints.
Constructors
Link copied to clipboard
constructor(eventStore: EventStore? = null, chainRepo: ChainRepository? = null, telemetry: TelemetryCollector? = null)
Properties
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Registers all task IDs currently in TaskRegistry with BGTaskScheduler, replays any persisted events from the last session, and restores in-progress chains.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun registerWithContext(taskId: String, block: suspend TaskExecutionContext.() -> Unit)