PassiveFaceCaptureView
@MainActor
struct PassiveFaceCaptureView : View
Represents a view for passive face capture. This view is responsible for capturing the user’s face passively and performing various actions based on the captured data. It includes features such as generating QR codes, scanning QR codes, and displaying detailed information about the captured face.
- path: A binding to a boolean value indicating the current path.
- qrBytes: A binding to an array of UInt8 representing the QR code bytes.
- recordId: A string representing the record ID.
- faceBytes: A data object representing the captured face bytes.
- password: A string representing the password.
- typeView: An optional TypeView enum representing the type of view.
- sessionForDecriptQr: An optional PassiveFaceCaptureSession representing the session for decrypting QR codes. Note: This view requires camera access permission from the user.
-
A state object representing the passive face capture factory.
Declaration
Swift
@StateObject @MainActor private var faceCaptureFactory: PassiveFaceCaptureFactory { get }
-
A boolean value indicating whether to show the camera access alert.
Declaration
Swift
@State @MainActor private var showAlert: Bool { get nonmutating set }
-
A string representing the instruction shown on the view.
Declaration
Swift
@State @MainActor var tvInstuction: String { get nonmutating set }
-
An array of UInt8 representing the QR code bytes.
Declaration
Swift
@State @MainActor var qrBytes: [UInt8] { get nonmutating set }
-
A boolean value indicating whether to capture the face.
Declaration
Swift
@State @MainActor var isCapture: Bool { get nonmutating set }
-
A boolean value indicating whether to show the error dialog.
Declaration
Swift
@State @MainActor var isShownErrorDialog: Bool { get nonmutating set }
-
A dictionary representing the metadata.
Declaration
Swift
@State @MainActor var metaData: [String : String] { get nonmutating set }
-
A string representing the record ID.
Declaration
Swift
@State @MainActor var recordId: String { get nonmutating set }
-
A data object representing the captured face bytes.
Declaration
Swift
@State @MainActor var faceBytes: Data { get nonmutating set }
-
An error type representing the error.
Declaration
Swift
@State @MainActor var error: SDKErrors { get nonmutating set }
-
An error type representing the other error.
Declaration
Swift
@State @MainActor var otherError: ErrorType { get nonmutating set }
-
A boolean value indicating whether the view is loading.
Declaration
Swift
@State @MainActor var isLoading: Bool { get nonmutating set }
-
A string representing the password.
Declaration
Swift
@MainActor var password: String
-
A value representing the current zoom factor.
Declaration
Swift
@State @MainActor private var currentZoomFactor: CGFloat { get nonmutating set }
-
A boolean value indicating whether the pinch gesture is active.
Declaration
Swift
@State @MainActor var isActivePinch: Bool { get nonmutating set }
-
TypeView enum representing the type of view.
Declaration
Swift
@MainActor var typeView: TypeView?
-
A passive face capture session.
Declaration
Swift
@MainActor var sessionForDecriptQr: PassiveFaceCaptureSession?
-
This EnvironmentObject navigationStore give access to all the view we want to navigate to and from It can be used to pop and push the view in the stack.
Declaration
Swift
@EnvironmentObject @MainActor private var navigationStore: NavigationStackController { get }
-
Updates the user interface based on the provided
PassiveFaceCaptureModel
. This method should be called on the main queue to ensure UI updates are performed on the main thread.Declaration
Swift
@MainActor func updateUI(model: PassiveFaceCaptureModel)
Parameters
model
The
PassiveFaceCaptureModel
object containing the data to update the UI. -
This method is called when the face capture session is completed.
- model: The
PassiveFaceCaptureModel
object containing the last state of the session.
Declaration
Swift
@MainActor func sessionCompleted(model: PassiveFaceCaptureModel)
- model: The
-
Displays an error message on the screen.
- model: The
PassiveFaceCaptureModel
object containing the error information.
Declaration
Swift
@MainActor func showError(model: PassiveFaceCaptureModel)
- model: The
-
Declaration
Swift
@MainActor var body: some View { get }
-
Check the camera permission
Declaration
Swift
@MainActor func checkCameraPermission()
-
Get the error view and show different dialog according to the error type
Declaration
Swift
@MainActor func showRelativeErrorDialog() -> some View
Return Value
A view representing the error view
-
Shows an error dialog for active timeout.
- error: The error object containing details about the error.
Declaration
Swift
@MainActor func showActiveTimeOutError(_ error: SDKErrors) -> some View
Return Value
A view that displays the error dialog.
-
Creates a confirmation dialog with a retry option based on the given error.
Declaration
Swift
@MainActor private func confirmationDialogWithRetry(_ error: SDKErrors) -> some View
Parameters
error
The error object containing localized error information.
Return Value
A view representing the confirmation dialog with retry option.
-
Show no face detected error dialog
- error: The error object
Declaration
Swift
@MainActor func showFaceCaptureNoFaceDetected(_ error: SDKErrors) -> some View
Return Value
A view representing the liveness error dialog
-
Show face capture multiple face error dialog
- error: The error object
Declaration
Swift
@MainActor func showFaceCapturMultipleFaceError(_ error: SDKErrors) -> some View
Return Value
A view representing the liveness error dialog
-
Show face capture error dialog
- error: The error object
Declaration
Swift
@MainActor func showFaceCapturError(_ error: SDKErrors) -> some View
Return Value
A view representing the liveness error dialog
-
- Displays an error dialog for liveness failure.
- - Parameters:
- error: The error that occurred during liveness check.
Declaration
Swift
@MainActor func showLivenessError(_ error: SDKErrors) -> some View
Parameters
error
The error that occurred during liveness check.
Return Value
A view representing the error dialog.
-
Creates a dialog view with a single button.
- error: The error object containing localized error information.
Declaration
Swift
@MainActor func dialogWithSingleButton(_ error: SDKErrors) -> some View
Return Value
A view that displays the dialog with the error information.
-
Set up camera configuration to initial
Declaration
Swift
@MainActor func setUpInitial()
-
Tries to decrypt the given SensePrint QR with the captured face.
Declaration
Swift
@MainActor func decryptSensePrintQR()
-
Declaration
Swift
@MainActor func testingPassiveFaceCaptureForVerification()