Version
| Technology |
Version |
| Workmanager version |
0.9.0+3 |
| Xcode version |
26.2 |
| Swift version |
6.2.3 |
| iOS deployment target |
26 (minimum 14) |
Describe the error
On iOS, following Option A in Quick Start, and executing registerPeriodicTask from Flutter, causes the following error messages (visible by debugging though XCode):
com.yourapp.YOUR_TASK_NAME is not advertised in the application's Info.plist
Could not schedule BGAppRefreshTask The operation couldn’t be completed. (BGTaskSchedulerErrorDomain error 3.)
Adding BGTaskSchedulerPermittedIdentifiers to Info.plist causes, however, another error:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'No launch handler registered for task with identifier com.yourapp.YOUR_TASK_NAME'
In fact, task gets scheduled through BGTaskScheduler.shared.submit before it's actually registered through BGTaskScheduler.shared.register.
Workaround:
- Add
BGTaskSchedulerPermittedIdentifiers to Info.plist and, in its array, add com.yourapp.YOUR_TASK_NAME
- Add the following to
AppDelegate.swift (ref: Option C step 2)
import workmanager_apple
WorkmanagerPlugin.registerPeriodicTask(
withIdentifier: "com.yourapp.YOUR_TASK_NAME",
frequency: NSNumber(value: 20 * 60) // duration in seconds, same of the one set via flutter
)
Output of flutter doctor
[✓] Flutter (Channel stable, 3.38.5, on macOS 15.7.3 24G419 darwin-arm64, locale
it-IT)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.2)
[✓] Chrome - develop for the web
[✓] Connected device (3 available)
[✓] Network resources
Version
Describe the error
On iOS, following Option A in Quick Start, and executing
registerPeriodicTaskfrom Flutter, causes the following error messages (visible by debugging though XCode):Adding
BGTaskSchedulerPermittedIdentifierstoInfo.plistcauses, however, another error:In fact, task gets scheduled through
BGTaskScheduler.shared.submitbefore it's actually registered throughBGTaskScheduler.shared.register.Workaround:
BGTaskSchedulerPermittedIdentifierstoInfo.plistand, in its array, addcom.yourapp.YOUR_TASK_NAMEAppDelegate.swift(ref: Option C step 2)Output of
flutter doctor[✓] Flutter (Channel stable, 3.38.5, on macOS 15.7.3 24G419 darwin-arm64, locale
it-IT)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.2)
[✓] Chrome - develop for the web
[✓] Connected device (3 available)
[✓] Network resources