From d7147fc119ee35c1e21b6976d3129559a87d1b0a Mon Sep 17 00:00:00 2001 From: Abhash Kumar Singh Date: Tue, 20 Aug 2024 09:36:54 -0700 Subject: [PATCH] chore: update Amplify dependency to 2.38.0 for clock skew support (#170) * chore: update Amplify dependency to 2.38.0 for clock skew support * revert debugging code --- .../xcshareddata/swiftpm/Package.resolved | 12 ++--- .../HostApp/Views/ExampleLivenessView.swift | 44 ++++++++++--------- Package.resolved | 4 +- Package.swift | 2 +- 4 files changed, 32 insertions(+), 30 deletions(-) diff --git a/HostApp/HostApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/HostApp/HostApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 61218e39..7859d774 100644 --- a/HostApp/HostApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/HostApp/HostApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/aws-amplify/amplify-swift", "state" : { - "revision" : "7846328106dba471b3fb35170155e92aad50d427", - "version" : "2.33.3" + "revision" : "79d062d354bb190666774e8ef3c83ad52f023889", + "version" : "2.38.0" } }, { @@ -50,8 +50,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/stephencelis/SQLite.swift.git", "state" : { - "revision" : "e78ae0220e17525a15ac68c697a155eb7a672a8e", - "version" : "0.15.0" + "revision" : "a95fc6df17d108bd99210db5e8a9bac90fe984b8", + "version" : "0.15.3" } }, { @@ -59,8 +59,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-log.git", "state" : { - "revision" : "e97a6fcb1ab07462881ac165fdbb37f067e205d5", - "version" : "1.5.4" + "revision" : "9cb486020ebf03bfa5b5df985387a14a98744537", + "version" : "1.6.1" } } ], diff --git a/HostApp/HostApp/Views/ExampleLivenessView.swift b/HostApp/HostApp/Views/ExampleLivenessView.swift index 7114dcdf..f24045d4 100644 --- a/HostApp/HostApp/Views/ExampleLivenessView.swift +++ b/HostApp/HostApp/Views/ExampleLivenessView.swift @@ -28,27 +28,29 @@ struct ExampleLivenessView: View { set: { _ in } ), onCompletion: { result in - switch result { - case .success: - withAnimation { viewModel.presentationState = .result } - case .failure(.sessionNotFound), .failure(.cameraPermissionDenied), .failure(.accessDenied): - viewModel.presentationState = .liveness - isPresented = false - case .failure(.userCancelled): - viewModel.presentationState = .liveness - isPresented = false - case .failure(.sessionTimedOut): - viewModel.presentationState = .error(.sessionTimedOut) - case .failure(.socketClosed): - viewModel.presentationState = .error(.socketClosed) - case .failure(.countdownNoFace), .failure(.countdownFaceTooClose), .failure(.countdownMultipleFaces): - viewModel.presentationState = .error(.countdownFaceTooClose) - case .failure(.invalidSignature): - viewModel.presentationState = .error(.invalidSignature) - case .failure(.cameraNotAvailable): - viewModel.presentationState = .error(.cameraNotAvailable) - default: - viewModel.presentationState = .liveness + DispatchQueue.main.async { + switch result { + case .success: + withAnimation { viewModel.presentationState = .result } + case .failure(.sessionNotFound), .failure(.cameraPermissionDenied), .failure(.accessDenied): + viewModel.presentationState = .liveness + isPresented = false + case .failure(.userCancelled): + viewModel.presentationState = .liveness + isPresented = false + case .failure(.sessionTimedOut): + viewModel.presentationState = .error(.sessionTimedOut) + case .failure(.socketClosed): + viewModel.presentationState = .error(.socketClosed) + case .failure(.countdownNoFace), .failure(.countdownFaceTooClose), .failure(.countdownMultipleFaces): + viewModel.presentationState = .error(.countdownFaceTooClose) + case .failure(.invalidSignature): + viewModel.presentationState = .error(.invalidSignature) + case .failure(.cameraNotAvailable): + viewModel.presentationState = .error(.cameraNotAvailable) + default: + viewModel.presentationState = .liveness + } } } ) diff --git a/Package.resolved b/Package.resolved index e9515eee..7859d774 100644 --- a/Package.resolved +++ b/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/aws-amplify/amplify-swift", "state" : { - "revision" : "dbc4a0412f4b5cd96f3e756e78bbd1e8e0a35a2f", - "version" : "2.35.4" + "revision" : "79d062d354bb190666774e8ef3c83ad52f023889", + "version" : "2.38.0" } }, { diff --git a/Package.swift b/Package.swift index ee5353c6..4e4d49e2 100644 --- a/Package.swift +++ b/Package.swift @@ -13,7 +13,7 @@ let package = Package( targets: ["FaceLiveness"]), ], dependencies: [ - .package(url: "https://github.com/aws-amplify/amplify-swift", exact: "2.35.4") + .package(url: "https://github.com/aws-amplify/amplify-swift", exact: "2.38.0") ], targets: [ .target(