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 store: WatchProfileStore
|
||||||
private let decoder = JSONDecoder()
|
private let decoder = JSONDecoder()
|
||||||
|
|
||||||
init(store: WatchProfileStore = .shared) {
|
init(store: WatchProfileStore) {
|
||||||
self.store = store
|
self.store = store
|
||||||
}
|
}
|
||||||
|
|
||||||
|
convenience init() {
|
||||||
|
self.init(store: .shared)
|
||||||
|
}
|
||||||
|
|
||||||
func handle(data: Data) {
|
func handle(data: Data) {
|
||||||
do {
|
do {
|
||||||
let profile = try decoder.decode(UserProfile.self, from: data)
|
let profile = try decoder.decode(UserProfile.self, from: data)
|
||||||
|
|||||||
@ -12,12 +12,12 @@ import LocalData
|
|||||||
struct SecureStorgageSampleApp: App {
|
struct SecureStorgageSampleApp: App {
|
||||||
init() {
|
init() {
|
||||||
_ = WatchConnectivityService.shared
|
_ = WatchConnectivityService.shared
|
||||||
do {
|
|
||||||
try StorageRouter.shared.registerCatalog(AppStorageCatalog.self)
|
|
||||||
} catch {
|
|
||||||
assertionFailure("Storage catalog registration failed: \(error)")
|
|
||||||
}
|
|
||||||
Task {
|
Task {
|
||||||
|
do {
|
||||||
|
try await StorageRouter.shared.registerCatalog(AppStorageCatalog.self)
|
||||||
|
} catch {
|
||||||
|
assertionFailure("Storage catalog registration failed: \(error)")
|
||||||
|
}
|
||||||
await StorageRouter.shared.registerKeyMaterialProvider(
|
await StorageRouter.shared.registerKeyMaterialProvider(
|
||||||
ExternalKeyMaterialProvider(),
|
ExternalKeyMaterialProvider(),
|
||||||
for: SampleKeyMaterialSources.external
|
for: SampleKeyMaterialSources.external
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user