From 1ac869c407e99c487a7622b48413a972d2e5e320 Mon Sep 17 00:00:00 2001 From: Pengfei Wang Date: Mon, 15 Jun 2026 15:41:35 +0800 Subject: [PATCH] fix: remove macOS-only security scoped bookmark options --- Package.swift | 1 - Sources/DataGatewayClient/FilePreparation.swift | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Package.swift b/Package.swift index 144de15..2806ffd 100644 --- a/Package.swift +++ b/Package.swift @@ -5,7 +5,6 @@ let package = Package( name: "SwiftDataGatewayClient", platforms: [ .iOS(.v18), - .macOS(.v15), ], products: [ .library(name: "DGWProto", targets: ["DGWProto"]), diff --git a/Sources/DataGatewayClient/FilePreparation.swift b/Sources/DataGatewayClient/FilePreparation.swift index 5aa2f15..e3d71ab 100644 --- a/Sources/DataGatewayClient/FilePreparation.swift +++ b/Sources/DataGatewayClient/FilePreparation.swift @@ -592,7 +592,7 @@ package struct SecurityScopedFileAccessor: SecurityScopedFileAccessing { } package func bookmarkData(for fileURL: URL) throws -> Data { - try fileURL.bookmarkData(options: [.minimalBookmark, .withSecurityScope], includingResourceValuesForKeys: nil, relativeTo: nil) + try fileURL.bookmarkData(options: [.minimalBookmark], includingResourceValuesForKeys: nil, relativeTo: nil) } private func resolveSecurityScopedURL(fileURL: URL, bookmarkData: Data?) -> URL { @@ -603,7 +603,7 @@ package struct SecurityScopedFileAccessor: SecurityScopedFileAccessing { var bookmarkDataIsStale = false guard let resolvedURL = try? URL( resolvingBookmarkData: bookmarkData, - options: [.withSecurityScope], + options: [], relativeTo: nil, bookmarkDataIsStale: &bookmarkDataIsStale ) else {