mirror of
https://github.com/spotiflacapp/SpotiFLAC-Mobile.git
synced 2026-05-31 19:05:05 +07:00
fix: guard security scoped bookmark options on iOS
This commit is contained in:
parent
0e00660e2e
commit
f1138ec7af
1 changed files with 18 additions and 3 deletions
|
|
@ -1046,8 +1046,13 @@ import Gobackend // Import Go framework
|
|||
private func createIosBookmarkFromPath(_ path: String) throws -> String {
|
||||
let url = URL(fileURLWithPath: path)
|
||||
do {
|
||||
#if os(macOS)
|
||||
let options: URL.BookmarkCreationOptions = .withSecurityScope
|
||||
#else
|
||||
let options: URL.BookmarkCreationOptions = []
|
||||
#endif
|
||||
let bookmarkData = try url.bookmarkData(
|
||||
options: .withSecurityScope,
|
||||
options: options,
|
||||
includingResourceValuesForKeys: nil,
|
||||
relativeTo: nil
|
||||
)
|
||||
|
|
@ -1075,9 +1080,14 @@ import Gobackend // Import Go framework
|
|||
var isStale = false
|
||||
let url: URL
|
||||
do {
|
||||
#if os(macOS)
|
||||
let options: URL.BookmarkResolutionOptions = .withSecurityScope
|
||||
#else
|
||||
let options: URL.BookmarkResolutionOptions = []
|
||||
#endif
|
||||
url = try URL(
|
||||
resolvingBookmarkData: bookmarkData,
|
||||
options: .withSecurityScope,
|
||||
options: options,
|
||||
relativeTo: nil,
|
||||
bookmarkDataIsStale: &isStale
|
||||
)
|
||||
|
|
@ -1110,9 +1120,14 @@ import Gobackend // Import Go framework
|
|||
var isStale = false
|
||||
let url: URL
|
||||
do {
|
||||
#if os(macOS)
|
||||
let options: URL.BookmarkResolutionOptions = .withSecurityScope
|
||||
#else
|
||||
let options: URL.BookmarkResolutionOptions = []
|
||||
#endif
|
||||
url = try URL(
|
||||
resolvingBookmarkData: bookmarkData,
|
||||
options: .withSecurityScope,
|
||||
options: options,
|
||||
relativeTo: nil,
|
||||
bookmarkDataIsStale: &isStale
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue