IOSTaskScheduler
iOS implementation of TaskScheduler backed by BGTaskScheduler.
⚠️ iOS Background Execution Limitations:
Apple's OS controls when tasks actually run. KMPWorker cannot override this.
BGAppRefreshTask (OneTime) has a strict time limit (~30 seconds).
BGProcessingTask (Periodic) may only run when device is idle and charging.
Tasks are NOT guaranteed to execute at requested intervals.
Always handle TaskState.Failed — the OS may kill the task at any time.
Required setup in AppDelegate:
BackgroundInitializerKt.initialize()Content copied to clipboard
Required in Info.plist:
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>your-task-id</string>
</array>Content copied to clipboard
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
Link copied to clipboard
Link copied to clipboard
open override fun registerWithContext(taskId: String, block: suspend TaskExecutionContext.() -> Unit)