SecureStorageSample/SecureStorageSample/StorageKeys/AppGroup/AppGroupUserProfileKey.swift

42 lines
1.3 KiB
Swift

import Foundation
import LocalData
import SharedKit
extension StorageKey where Value == UserProfile {
/// Stores a shared user profile in the App Group container.
/// - Domain: App Group File System
/// - Security: None
/// - Sync: Never
nonisolated static let appGroupUserProfile = StorageKey(
name: "app_group_user_profile.json",
domain: .appGroupFileSystem(
identifier: StorageServiceIdentifiers.appGroupIdentifier,
directory: .documents
),
security: .none,
serializer: .json,
owner: "SampleApp",
description: "Stores a profile shared between the app and extensions.",
availability: .phoneOnly,
syncPolicy: .never
)
nonisolated static func appGroupUserProfileKey(
directory: FileDirectory = .documents
) -> StorageKey {
StorageKey(
name: "app_group_user_profile.json",
domain: .appGroupFileSystem(
identifier: StorageServiceIdentifiers.appGroupIdentifier,
directory: directory
),
security: .none,
serializer: .json,
owner: "SampleApp",
description: "Stores a profile shared between the app and extensions.",
availability: .phoneOnly,
syncPolicy: .never
)
}
}