From 0750e2e0fdd1c4a9340c70278926cb34a96106b9 Mon Sep 17 00:00:00 2001 From: Ross Savage <551697+dangeross@users.noreply.github.com> Date: Mon, 18 Nov 2024 20:01:49 +0100 Subject: [PATCH] Fix swift URL init compatibility (#569) --- .../Sources/BreezSDKLiquid/SDKNotificationService.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/bindings/langs/swift/Sources/BreezSDKLiquid/SDKNotificationService.swift b/lib/bindings/langs/swift/Sources/BreezSDKLiquid/SDKNotificationService.swift index b4499d65b..8f6dde454 100644 --- a/lib/bindings/langs/swift/Sources/BreezSDKLiquid/SDKNotificationService.swift +++ b/lib/bindings/langs/swift/Sources/BreezSDKLiquid/SDKNotificationService.swift @@ -28,7 +28,13 @@ open class SDKNotificationService: UNNotificationServiceExtension { } if connectRequest.config.cacheDir == nil { - connectRequest.config.cacheDir = URL(filePath: connectRequest.config.workingDir).appendingPathComponent("pluginCache").path + var workingDir: URL + if #available(iOS 16, *) { + workingDir = URL(filePath: connectRequest.config.workingDir) + } else { + workingDir = URL(fileURLWithPath: connectRequest.config.workingDir) + } + connectRequest.config.cacheDir = workingDir.appendingPathComponent("pluginCache").path } if let currentTask = self.getTaskFromNotification() {