diff --git a/example/ios/Runner/AppDelegate.swift b/example/ios/Runner/AppDelegate.swift index 08b909cb..d3b40c1f 100644 --- a/example/ios/Runner/AppDelegate.swift +++ b/example/ios/Runner/AppDelegate.swift @@ -23,7 +23,7 @@ import workmanager WorkmanagerPlugin.registerBGProcessingTask(withIdentifier: "be.tramckrijte.workmanagerExample.taskId") WorkmanagerPlugin.registerBGProcessingTask(withIdentifier: "be.tramckrijte.workmanagerExample.rescheduledTask") WorkmanagerPlugin.registerBGProcessingTask(withIdentifier: "be.tramckrijte.workmanagerExample.simpleDelayedTask") - WorkmanagerPlugin.registerBGProcessingTask(withIdentifier: "be.tramckrijte.workmanagerExample.iOSBackgroundProcessingTask") + WorkmanagerPlugin.registerBGProcessingTask(withIdentifier: "be.tramckrijte.workmanagerExample.iOSBackgroundProcessingTask") // When this task is scheduled from dart it will run with minimum 20 minute frequency. The // frequency is not guaranteed rather iOS will schedule it as per user's App usage pattern. diff --git a/workmanager/ios/Classes/BackgroundTaskOperation.swift b/workmanager/ios/Classes/BackgroundTaskOperation.swift index d832f139..42028092 100644 --- a/workmanager/ios/Classes/BackgroundTaskOperation.swift +++ b/workmanager/ios/Classes/BackgroundTaskOperation.swift @@ -24,7 +24,6 @@ class BackgroundTaskOperation: Operation { self.backgroundMode = backgroundMode } - override func main() { let semaphore = DispatchSemaphore(value: 0) let worker = BackgroundWorker(mode: self.backgroundMode, diff --git a/workmanager/ios/Classes/BackgroundWorker.swift b/workmanager/ios/Classes/BackgroundWorker.swift index a6aee7d8..843f4c4d 100644 --- a/workmanager/ios/Classes/BackgroundWorker.swift +++ b/workmanager/ios/Classes/BackgroundWorker.swift @@ -113,7 +113,7 @@ class BackgroundWorker { backgroundMethodChannel?.invokeMethod( BackgroundChannel.onResultSendCommand, - arguments:arguments, + arguments: arguments, result: { flutterResult in cleanupFlutterResources() let taskSessionCompleter = Date() diff --git a/workmanager/ios/Classes/SwiftWorkmanagerPlugin.swift b/workmanager/ios/Classes/SwiftWorkmanagerPlugin.swift index 03ed3e40..80b6de6c 100644 --- a/workmanager/ios/Classes/SwiftWorkmanagerPlugin.swift +++ b/workmanager/ios/Classes/SwiftWorkmanagerPlugin.swift @@ -148,7 +148,7 @@ public class SwiftWorkmanagerPlugin: FlutterPluginAppLifeCycleDelegate { /// Immediately starts a one off task @available(iOS 13.0, *) - public static func startOneOffTask(identifier: String, taskIdentifier: UIBackgroundTaskIdentifier, inputData:String, delaySeconds: Int64) { + public static func startOneOffTask(identifier: String, taskIdentifier: UIBackgroundTaskIdentifier, inputData: String, delaySeconds: Int64) { let operationQueue = OperationQueue() // Create an operation that performs the main part of the background task let operation = BackgroundTaskOperation( @@ -332,7 +332,6 @@ extension SwiftWorkmanagerPlugin: FlutterPlugin { let inputData = arguments[method.Arguments.inputData.rawValue] as? String - taskIdentifier = UIApplication.shared.beginBackgroundTask(withName: uniqueTaskIdentifier, expirationHandler: { // Mark the task as ended if time is expired, otherwise iOS might terminate and will throttle future executions UIApplication.shared.endBackgroundTask(taskIdentifier)