Skip to content

Commit e0272dd

Browse files
committed
update host app
1 parent 1b62ca3 commit e0272dd

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

HostApp/HostApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

HostApp/HostApp/Views/ExampleLivenessView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ struct ExampleLivenessView: View {
9393
LivenessCheckErrorContentView.invalidSignature
9494
case .cameraNotAvailable:
9595
LivenessCheckErrorContentView.cameraNotAvailable
96+
case .validation:
97+
LivenessCheckErrorContentView.validation
9698
default:
9799
LivenessCheckErrorContentView.unexpected
98100
}

HostApp/HostApp/Views/LivenessCheckErrorContentView.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ extension LivenessCheckErrorContentView {
5555
name: "The signature on the request is invalid.",
5656
description: "Ensure the device time is correct and try again."
5757
)
58+
59+
static let validation = LivenessCheckErrorContentView(
60+
name: "The input fails to satisfy the constraints specified by the service.",
61+
description: "Please try again."
62+
)
5863

5964
static let cameraNotAvailable = LivenessCheckErrorContentView(
6065
name: "The camera could not be started.",

Package.resolved

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ class FaceLivenessDetectionViewModel: ObservableObject {
117117
}
118118
case .unexpectedClosure(let error):
119119
DispatchQueue.main.async {
120-
// known liveness errors already set `livenessState`
120+
// known liveness/rekognition service exceptions set the `livenessState` and
121+
// invoke onCompletion() callback directly
121122
guard !error.isKnownLivenessError() else { return }
122123
self?.livenessState.unrecoverableStateEncountered(.socketClosed)
123124
}
@@ -222,7 +223,7 @@ class FaceLivenessDetectionViewModel: ObservableObject {
222223
try livenessService?.initializeLivenessStream(
223224
withSessionID: sessionID,
224225
userAgent: UserAgentValues.standard().userAgentString,
225-
challenges: [challengeOptions.faceMovementChallengeOption.challenge,
226+
challenges: [//challengeOptions.faceMovementChallengeOption.challenge,
226227
challengeOptions.faceMovementAndLightChallengeOption.challenge],
227228
options: .init(
228229
attemptCount: Self.attemptCount,

0 commit comments

Comments
 (0)