Scan Setup

The SDK provides your application with a list of captured finger images, a related quality assessment, and some other finger specific data. More about the data structure can be found in BcmFingerImage.

There are additional callbacks, which are listed in PBcmFlowDelegate.

No further user interface is displayed after a successful or failed scan, and no further action is taken from the SDK side. It is your application's responsibility to implement an appropriate response to a scan.

Scan Flow Delegate

Implement the PBcmFlowDelegate interface. The delegate enables communication from the scan Controller (BcmScanController) to your application.

A scan returns a set of BcmFingerImage instances to your application within the 'bcmFingerImagesResult' delegate

Swift:

// It's important to implement PBcmFlowDelegate 
// which has required and optional delegates of Scan Controller 
// There are 2 required delegate methods
extension YourViewController: PBcmFlowDelegate {

    func bcmUnrecoverableError(
        errorCode: ScanError,
        errorMessage: String
    ) {
        // Something went wrong 
        // Notify your user
    }

    func bcmFingerImagesResult(
        fingerImages: Set<BcmFingerImage>
    ) {
        // A scan has completed.
        // Inspect the BcmFingerImage structure to check the recorded fingerprints

        // You can use BcmResultController to show results as below
        let bcmResultController = BcmResultController()
        DispatchQueue.main.async { 
            bcmResultController.fingerImages = fingerImages
            bcmResultController.modalPresentationStyle = .fullScreen

            // Dismiss the scan controller 
            // When scan controller dismissed, show result controller
            self.bcmScanController?.dismiss(animated: false, completion: {
                self.present(self._bcmResultController,
                    animated: false,
                    completion: nil)
                }
            )
        }
    }
}

The Biocapture SDK's scan Controller offers many customization options. For example, you may wish to add a close button to enable the user to cancel the scan, listen for additional delegate events, or modify the Controller's look to match your brand.

Close Button Example Sample Codes

Swift:

extension YourViewController {

    func setupCloseButton() {
        bcmScanController?.getCloseBtn().bcm_addTapGesture(
            tapNumber: 1,
            target: self,
            action: #selector(self.closeBtn)
        )
    }

    @objc func closeBtn(
        sender: UITapGestureRecognizer
    ) {
        DispatchQueue.main.async {
            bcmScanController?.dismiss(animated: true, completion: nil)
        }
    }
}

See Also

  • BcmScanController for the Controller configuration options, including view extension options for user cancellation or opening an application menu.
  • PBcmFlowDelegate for additional delegate events.
  • Camera configuration allows you to configure camera specific parameters.
  • Branding for asset and color scheme customization.

results matching ""

    No results matching ""