PBcmFlowDelegate

The scan flow delegate receives messages about scan progress and results by BcmScanController. It provides your application with the scan result or error, including environment-related errors such as license or calibration problems.

You may provide your own scan flow by implementing the following interface:

Interface

Swift:

public enum ScanError {
    /**
     * There is a problem with the given license key.
     * Please also check the network connection - a network connection is mandatory.
     */
    case ScanErrorLicenseProblem

    /**
     * No pre-calibration configuration for the device was found.
     */
    case ScanErrorDeviceNotCalibrated

    /**
     * An internal error occurred, please inspect the logs for details.
     */
    case ScanErrorUnknown

    /**
     * The camera cannot be used due to an error.
     */
    case ScanErrorCameraProblem
}

public protocol PBcmFlowDelegate {
    /**
     * Something went terribly wrong (as indicated by errorCode) and things are now broken.
     * Notify your user.
     */
    func unrecoverableError(
        errorCode: ScanError,
        errorMessage: String
    )

    /**
     * A scan has completed.
     * Inspect the BcmFingerImageDTO structure to check the recorded fingerprints.
     * The scan termination can be configured via the `BcmSdkConfig`
     */
    func fingerImagesResult(
        fingerImages: Set<BcmFingerImageDTO>
    )

    /**
     * Optional
     */
    /**
     * Finger selection dialog callback.
     * The callback contains a set of all finger selected in the Finger selection dialog.
     */
    func fingerSelected(
        fingerSelected: Set<BcmFingerHandDTO>
    )

    /**
     * Setup has completed and fingers may now be scanned.
     */
    func readyToScan()

    /**
     * Fingers are recognized on the given preview position with a given evaluation score.
     * Inspect the AssignedBoundingBox structure for the object details.
     * The callback will continuously called, during the scan.
     */
    func boundingBoxesAssigned(
        assignedBoundingboxes: Set<AssignedBoundingBox>
    )

    /**
     * Internal finger cache was updated, because fingers with a better score was detected.
     * Inspect the BcmFingerImageLiveScoreDTO structure to check live score.
     * The callback will continuously called, during the scan.
     */
    func fingerImagesCachedLiveScore(
        fingerImageLiveScores: Set<BcmFingerImageLiveScoreDTO>
    )

}

Usage

Implement at least PBcmFlowDelegate.unrecoverableError() and PBcmFlowDelegate.fingerImagesResult() for receiving scan results.

Using the PBcmFlowDelegate.fingerImagesCachedLiveScore() it is possible to implement your own scan termination logic. Please refer to Custom Scan Termination for an example implementation.

The BCM SDK callbacks can be implemented in the in the AppDelegate as follows

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
    ...
}

// MARK: - Bcm SDK callbacks
extension AppDelegate: PBcmFlowDelegate {

    func unrecoverableError(
        errorCode: ScanError
    ) {
    }

    func fingerImagesResult(
        _ fingerImages: Set<BcmFingerImageDTO>
    ) {
    }

    /**
     * Optional
     */
    func fingerSelected(
        _ fingerSelected: Set<BcmFingerHandDTO>
    ) {
    }

    func readyToScan() {
    }

    func boundingBoxesAssigned(
        _ assignedBoundingboxes: Set<AssignedBoundingBox>
    ) {
    }

    func fingerImagesCachedLiveScore(
        _ fingerImageLiveScores: Set<BcmFingerImageLiveScoreDTO>
    ) {
    }

}

See Also

results matching ""

    No results matching ""