iOS set up error: type 'WorkmanagerPlugin' has no member 'registerTask'
- [x] I have read the README
- [x] I have done the setup for Android
- [x] I have done the setup for iOS
- [x] I have ran the sample app and it does not work there
Describe the error After following the iOS set up guide, I am receiving this error from my AppDelegate when trying to run the app:
error: type 'WorkmanagerPlugin' has no member 'registerTask'
Here is my AppDelegate:
import UIKit
import Flutter
import workmanager
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
InitUnityIntegrationWithOptions(argc: CommandLine.argc, argv: CommandLine.unsafeArgv, launchOptions)
GeneratedPluginRegistrant.register(with: self)
UIApplication.shared.setMinimumBackgroundFetchInterval(TimeInterval(60*15))
WorkmanagerPlugin.registerTask(withIdentifier: "com.bundle.app.1")
WorkmanagerPlugin.registerTask(withIdentifier: "com.bundle.app.2")
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
}
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
```
**Output of `flutter doctor -v`**
Found the solution with this thread: https://github.com/fluttercommunity/flutter_workmanager/issues/189
Replace
WorkmanagerPlugin.registerTask(withIdentifier: "com.bundle.app.1") WorkmanagerPlugin.registerTask(withIdentifier: "com.bundle.app.2")
with:
WorkmanagerPlugin.register(with: self.registrar(forPlugin: "com.bundleId.workmanager.WorkmanagerPlugin")!)
@jafitz26 It's not ?
WorkmanagerPlugin.register(with: self.registrar(forPlugin: "be.tramckrijte.workmanager.WorkmanagerPlugin")!)
I got the following error :
flutter: PlatformException(bgTaskSchedulingFailed(Error Domain=BGTaskSchedulerErrorDomain Code=3 "(null)") error, Scheduling the task using BGTaskScheduler has failed.
This may be due to too many tasks being scheduled but not run.
See the error for details: Error Domain=BGTaskSchedulerErrorDomain Code=3 "(null)"., null, null)
Edit : For people on 0.5.0-dev.8, we can only use "workmanager.background.task" as task identifier for background processing.
For people on 0.5.0-dev.8, we can only use "workmanager.background.task" as task identifier for background processing.
Hi, Where I can find this info?
For people on 0.5.0-dev.8, we can only use "workmanager.background.task" as task identifier for background processing.Hi, Where I can find this info?
In source code and older doc version.
Which documents? Do you have a link?
For people on 0.5.0-dev.8, we can only use "workmanager.background.task" as task identifier for background processing.Hi, Where I can find this info?
In source code and older doc version.
Which documents? Do you have a link?
Which documents? Do you have a link?
For people on 0.5.0-dev.8, we can only use "workmanager.background.task" as task identifier for background processing.Hi, Where I can find this info?
In source code and older doc version.
Which documents? Do you have a link?
Source code of the SDK.