diff --git a/HostApp/HostApp.xcodeproj/project.pbxproj b/HostApp/HostApp.xcodeproj/project.pbxproj index 547500e5..9110dd94 100644 --- a/HostApp/HostApp.xcodeproj/project.pbxproj +++ b/HostApp/HostApp.xcodeproj/project.pbxproj @@ -701,7 +701,7 @@ repositoryURL = "https://github.com/aws-amplify/amplify-ui-swift-liveness"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 1.0.0; + minimumVersion = 1.1.1; }; }; 9077AB3529E5D28900433155 /* XCRemoteSwiftPackageReference "amplify-swift" */ = { diff --git a/Package.swift b/Package.swift index dd738e4d..a4e1f3eb 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", from: "2.14.1") + .package(url: "https://github.com/aws-amplify/amplify-swift", from: "2.15.4") ], targets: [ .target( diff --git a/Sources/FaceLiveness/Utilities/UserAgent.swift b/Sources/FaceLiveness/Utilities/UserAgent.swift index 5858108c..d0f6b09c 100644 --- a/Sources/FaceLiveness/Utilities/UserAgent.swift +++ b/Sources/FaceLiveness/Utilities/UserAgent.swift @@ -57,7 +57,7 @@ struct UserAgentValues { swiftVersion: Swift().version(), unameMachine: Device.current.machine.replacingOccurrences(of: ",", with: "_"), locale: Locale.current.identifier, - lib: "lib/amplify-ui-swift-face-liveness/1.1.0", + lib: "lib/amplify-ui-swift-face-liveness/1.1.1", additionalMetadata: additionalMetadata ) } diff --git a/Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel+FaceDetectionResultHandler.swift b/Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel+FaceDetectionResultHandler.swift index 70e47955..a7458ed4 100644 --- a/Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel+FaceDetectionResultHandler.swift +++ b/Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel+FaceDetectionResultHandler.swift @@ -10,7 +10,6 @@ import SwiftUI @_spi(PredictionsFaceLiveness) import AWSPredictionsPlugin fileprivate let initialFaceDistanceThreshold: CGFloat = 0.32 -fileprivate let noFitTimeoutInterval: TimeInterval = 7 extension FaceLivenessDetectionViewModel: FaceDetectionResultHandler { func process(newResult: FaceDetectionResult) { diff --git a/Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel.swift b/Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel.swift index bebeb1e8..a29622f5 100644 --- a/Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel.swift +++ b/Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel.swift @@ -11,6 +11,7 @@ import AVFoundation @_spi(PredictionsFaceLiveness) import AWSPredictionsPlugin fileprivate let videoSize: CGSize = .init(width: 480, height: 640) +fileprivate let defaultNoFitTimeoutInterval: TimeInterval = 7 @MainActor class FaceLivenessDetectionViewModel: ObservableObject { @@ -41,6 +42,14 @@ class FaceLivenessDetectionViewModel: ObservableObject { var faceMatchedTimestamp: UInt64? var noFitStartTime: Date? + var noFitTimeoutInterval: TimeInterval { + if let sessionTimeoutMilliSec = sessionConfiguration?.ovalMatchChallenge.oval.ovalFitTimeout { + return TimeInterval(sessionTimeoutMilliSec/1_000) + } else { + return defaultNoFitTimeoutInterval + } + } + init( faceDetector: FaceDetector, faceInOvalMatching: FaceInOvalMatching,