Skip to main content

LiveIDScannerHelper

public class LiveIDScannerHelper extends NSObject

The LiveIDScannerHelper class is a helper class to work with the Live ID feature.

Constructors

public init(bidScannerView: BIDScannerView, overlayFrame: CGRect? = nil, liveIdResponseDelegate: LiveIDResponseDelegate)

  • Creates an object of LiveIDScannerHelper.
note
  • CGRector ratio should be same for bidScannerView and overlayFrame
  • Make sure when you use navigation bar, the above point should be followed. If ratio is not maintained you will have issues with expression detection and staying in focus.
Parameter
bidScannerViewBIDScannerView: A custom view to be provided by the application. This is generally used for UI customization.
overlayFrameCGRect: An overlay rect which is placed on top of the BIDScannerView object.
liveIdResponseDelegateLiveIDResponseDelegate: The block to execute after the response is received.

Method Summary

Parameters
voidstartLiveIDScanning(isWithoutLivenessCheck: Bool? = false, dvcID: String? = nil, mobileSessionId: String? = nil, mobileDocumentId: String? = nil)- isWithoutLivenessCheck is optional value. By default LiveID scanning will perform the Liveness but when isWithoutLivenessCheck = true SDK will skip the Liveness check.
- Starts the LiveID scanning. dvcID (Document Verification Connector Identifier) is optional.
- If dvcID is provided, Liveness check is performed using the dvcID
- else Liveness check performed using default dvcID set against the License key
voidstopLiveIDScanningStops Live ID scanning.

Method Details

startLiveIDScanning

startLiveIDScanning(isWithoutLivenessCheck: Bool? = false, dvcID: String? = nil, mobileSessionId: String? = nil, mobileDocumentId: String? = nil)

  • Starts the LiveI D scanning. dvcID (Document Verification Connector Identifier) is optional.
  • If dvcID is given, Liveness check is performed using give dvcID
  • Else Liveness check performed using default dvcID set against License key.
ParameterDescription
isWithoutLivenessCheckBool: (Optional) Pass true to skip the liveness check on the image.
dvcIDString: (Optional) Document Verification Connector Identifier.
mobileSessionIdString: (Optional) Unique Session ID that can be used for event tracking or validation purposes.
mobileDocumentIdString: (Optional) Unique Document ID that can be used for event tracking or validation purposes.

stopLiveIDScanning

public void stopLiveIDScanning()

  • Stops Live ID scanning.

Interface Summary

Parameters
LiveIDResponseDelegateCallback for the event when Live ID is captured, face expressions are changed, or face is out of focus.

Method Summary

Parameters
voidfaceLivenessCheckStarted()Called when scanner has started liveness check. This protocol method is Optional.
voidfocusOnFaceChanged(isFocused: Bool?, message: String?)Called when if the user's face focus changes within the scanner focus area. This protocol method is Optional.
voidliveIdDetectionCompleted(_ liveIdImage: UIImage?, signatureToken: String?, livenessResult: String?, mobileSessionId: String?, mobileDocumentId: String?, error: ErrorResponse?)Called when Live ID scanning is completed. This protocol method is Required.
voidliveIdDidDetectErrorInScanning(error: ErrorResponse?)Called when an error is occurred during Live ID scanning. This protocol method is Optional.

faceLivenessCheckStarted

func faceLivenessCheckStarted()

  • Called when the scanner has started liveness check.

focusOnFaceChanged

func focusOnFaceChanged(isFocused: Bool?, message: String?)

  • Called when the user's face focus changes within the scanner focus area.
Parameters
isFocusedbooleanA flag that indicates if the user's face is in the focus area.
messageStringMessage:
- Please align the face in the center.
- Face is not found.
- Multiple faces found.

liveIdDetectionCompleted

func liveIdDetectionCompleted(_ liveIdImage: UIImage?, signatureToken: String?, String?, livenessResult: String?, mobileSessionId: String?, mobileDocumentId: String?, error: ErrorResponse?)

  • Called when Live ID scanning is completed.
Parameters
liveIdImageUIImageAn image of person's face.
signatureTokenStringA token that carries information about Live ID. This is used to verify if the user's Live ID is modified or not before storing it on the BlockID blockchain platform.
livenessResultStringJSON String result data of Liveness check.
mobileSessionIdString(Optional) Unique Session ID
mobileDocumentIdString(Optional) Unique Document ID
errorErrorResponseAn object of ErrorResponse.

liveIdDidDetectErrorInScanning

func liveIdDidDetectErrorInScanning(error: ErrorResponse?)

  • Called when an error occurs during Live ID scanning.
Parameters
errorErrorResponseAn error object.