Fix swift URL init compatibility (#569)

This commit is contained in:
Ross Savage
2024-11-18 20:01:49 +01:00
committed by GitHub
parent 802e9eece7
commit 0750e2e0fd

View File

@@ -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() {