Add file provider for iOS
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import ApplicationLibrary
|
||||
import FileProvider
|
||||
import Foundation
|
||||
import Libbox
|
||||
import Library
|
||||
@@ -77,6 +78,20 @@ class ApplicationDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCe
|
||||
} catch {
|
||||
NSLog("setup profile server error: \(error.localizedDescription)")
|
||||
}
|
||||
registerFileProviderDomain()
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 16.0, *)
|
||||
private nonisolated func registerFileProviderDomain() {
|
||||
let domain = NSFileProviderDomain(
|
||||
identifier: NSFileProviderDomainIdentifier("io.nekohasekai.sfavt.workingdir"),
|
||||
displayName: "sing-box"
|
||||
)
|
||||
NSFileProviderManager.add(domain) { error in
|
||||
if let error {
|
||||
NSLog("Failed to add file provider domain: \(error)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user