Update SecureStorageSample Watch App, SecureStorgageSample
This commit is contained in:
parent
8f0046e971
commit
4adcb63797
@ -8,10 +8,14 @@ final class UserProfileWatchHandler: WatchDataHandling {
|
||||
private let store: WatchProfileStore
|
||||
private let decoder = JSONDecoder()
|
||||
|
||||
init(store: WatchProfileStore = .shared) {
|
||||
init(store: WatchProfileStore) {
|
||||
self.store = store
|
||||
}
|
||||
|
||||
convenience init() {
|
||||
self.init(store: .shared)
|
||||
}
|
||||
|
||||
func handle(data: Data) {
|
||||
do {
|
||||
let profile = try decoder.decode(UserProfile.self, from: data)
|
||||
|
||||
@ -12,12 +12,12 @@ import LocalData
|
||||
struct SecureStorgageSampleApp: App {
|
||||
init() {
|
||||
_ = WatchConnectivityService.shared
|
||||
Task {
|
||||
do {
|
||||
try StorageRouter.shared.registerCatalog(AppStorageCatalog.self)
|
||||
try await StorageRouter.shared.registerCatalog(AppStorageCatalog.self)
|
||||
} catch {
|
||||
assertionFailure("Storage catalog registration failed: \(error)")
|
||||
}
|
||||
Task {
|
||||
await StorageRouter.shared.registerKeyMaterialProvider(
|
||||
ExternalKeyMaterialProvider(),
|
||||
for: SampleKeyMaterialSources.external
|
||||
|
||||
Loading…
Reference in New Issue
Block a user