Skip to content

Commit

Permalink
Merge pull request #791 from adamgic/ios_serial_execution_queue
Browse files Browse the repository at this point in the history
[iOS] Use serial queue for execution of iOS keychain operations
  • Loading branch information
juliansteenbakker authored Jan 4, 2025
2 parents 76bffc7 + 876da19 commit e2c1b97
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class SwiftFlutterSecureStoragePlugin: NSObject, FlutterPlugin, FlutterSt

private let flutterSecureStorageManager: FlutterSecureStorage = FlutterSecureStorage()
private var secStoreAvailabilitySink: FlutterEventSink?
private let serialExecutionQueue = DispatchQueue(label: "flutter_secure_storage_service")

public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(name: "plugins.it_nomads.com/flutter_secure_storage", binaryMessenger: registrar.messenger())
Expand All @@ -29,7 +30,7 @@ public class SwiftFlutterSecureStoragePlugin: NSObject, FlutterPlugin, FlutterSt
}
}

DispatchQueue.global(qos: .userInitiated).async {
serialExecutionQueue.async {
switch (call.method) {
case "read":
self.read(call, handleResult)
Expand Down

0 comments on commit e2c1b97

Please sign in to comment.