Skip to content

Commit

Permalink
swift formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ened committed Apr 8, 2024
1 parent 957fba5 commit 334bd09
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion example/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion workmanager/ios/Classes/BackgroundTaskOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class BackgroundTaskOperation: Operation {
self.backgroundMode = backgroundMode
}


override func main() {
let semaphore = DispatchSemaphore(value: 0)
let worker = BackgroundWorker(mode: self.backgroundMode,
Expand Down
2 changes: 1 addition & 1 deletion workmanager/ios/Classes/BackgroundWorker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class BackgroundWorker {

backgroundMethodChannel?.invokeMethod(
BackgroundChannel.onResultSendCommand,
arguments:arguments,
arguments: arguments,
result: { flutterResult in
cleanupFlutterResources()
let taskSessionCompleter = Date()
Expand Down
3 changes: 1 addition & 2 deletions workmanager/ios/Classes/SwiftWorkmanagerPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 334bd09

Please sign in to comment.