Refactor to eliminate hardcoded identifiers
Read package identifier and app group ID from Info.plist at runtime via AppConfiguration. This enables SFM.System to use TeamID-prefixed app group format required by macOS Sequoia, fixing the privacy prompt when accessing app group data.
This commit is contained in:
@@ -7,7 +7,7 @@ import Library
|
||||
|
||||
#if os(iOS) || os(tvOS)
|
||||
public class UIProfileUpdateTask: BGAppRefreshTask {
|
||||
private static let taskSchedulerPermittedIdentifier = "\(FilePath.packageName).update_profiles"
|
||||
private static let taskSchedulerPermittedIdentifier = AppConfiguration.backgroundTaskID
|
||||
|
||||
private static var registered = false
|
||||
public static func configure() throws {
|
||||
|
||||
@@ -135,7 +135,7 @@ public struct CoreView: View {
|
||||
private nonisolated func openInFilesApp() async {
|
||||
do {
|
||||
let domains = try await NSFileProviderManager.domains()
|
||||
guard let domain = domains.first(where: { $0.identifier.rawValue == "io.nekohasekai.sfavt.workingdir" }) else {
|
||||
guard let domain = domains.first(where: { $0.identifier.rawValue == AppConfiguration.fileProviderDomainID }) else {
|
||||
throw NSError(domain: "CoreView", code: 0, userInfo: [NSLocalizedDescriptionKey: "File provider domain not found"])
|
||||
}
|
||||
guard let manager = NSFileProviderManager(for: domain) else {
|
||||
|
||||
Reference in New Issue
Block a user