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.
  • 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 }
  • 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 }
  • An error type representing the error.

    Declaration

    Swift

    @State
    @MainActor
    var error: SDKErrors { get nonmutating set }
  • A boolean value indicating whether the view is loading.

    Declaration

    Swift

    @State
    @MainActor
    var isLoading: Bool { get nonmutating set }
  • 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 }
  • Stored value for generating QRcode

    Declaration

    Swift

    @MainActor
    let genrateQRModel: GenerateSensePrintModel
  • Verify SensePrint model.

    Declaration

    Swift

    @MainActor
    let decryptSensePrintModel: DecryptSensePrintModel
  • Loader text

    Declaration

    Swift

    @State
    @MainActor
    var loaderText: String { get nonmutating set }
  • Declaration

    Swift

    @MainActor
    var body: some View { get }
  • Check the camera permission

    Declaration

    Swift

    @MainActor
    func checkCameraPermission()
  • 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.

    Declaration

    Swift

    @MainActor
    func sessionCompleted(model: PassiveFaceCaptureModel)
  • Displays an error message on the screen.

    Declaration

    Swift

    @MainActor
    func showError(model: PassiveFaceCaptureModel)
  • 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()
  • Generates a SensePrint QR code. This function generates a SensePrint QR code by creating a request with the provided data and calling the generateSensePrintQR method of the sessionHolder in the current SDK state. The generated QR code data is then stored in the sensePrintData property.

    • generateQRModel will be passed in the generateSensePrintOR funtion

    Declaration

    Swift

    @MainActor
    func generateSensePrintQR()

    Return Value

    None.

Testing function for the UI