name = "background-fetch"
summary = "Periodic background wake (BGTaskScheduler / WorkManager) (free; EXPERIMENTAL — not yet device-tested)"
notes = [
"EXPERIMENTAL: the OS decides WHEN (and whether) a background wake fires — it can't be exercised reliably in CI/simulator. Verify on a physical device (iOS: pause in Xcode's debugger and trigger `_simulateLaunchForTaskWithIdentifier:`; Android: `adb shell cmd jobscheduler run`).",
"Timing is best-effort and OS-throttled: iOS BGAppRefreshTask is opportunistic; Android WorkManager enforces a 15-minute minimum interval. Treat `min_interval_seconds` as a floor, not a guarantee.",
"iOS: the task identifier is `mobiler.refresh` (registered at launch + listed in BGTaskSchedulerPermittedIdentifiers). The `id` you pass is an opaque label echoed back in the event.",
]
[android]
sources = ["android/BackgroundFetchPlugin.kt", "android/BackgroundFetchWorker.kt"]
register = '"background-fetch" to BackgroundFetchPlugin(application)'
permissions = ["android.permission.POST_NOTIFICATIONS"]
gradle_deps = ["androidx.work:work-runtime-ktx:2.9.1"]
[ios]
sources = ["ios/BackgroundFetchPlugin.swift"]
register = 'case "background-fetch": return await BackgroundFetchPlugin.handle(op: op, input: input)'
register_stream = 'case "background-fetch": await BackgroundFetchPlugin.subscribe(op: op, input: input, emit: emit)'
app_launch = ["BackgroundFetchPlugin.bootstrap()"]
[ios.info_plist]
UIBackgroundModes = ["fetch", "processing"]
BGTaskSchedulerPermittedIdentifiers = ["mobiler.refresh"]