Skip to main content

LiveIDScannerHelper

public class LiveIDScannerHelper extends Object

↳ package com.onekosmos.blockid.sdk.cameramodule.liveID


The LiveIDScannerHelper class is a helper class for the Live ID feature.

Constructors​

public LiveIDScannerHelper(@NonNull Context context, @NonNull BIDScannerView bidLiveIDScannerView, View scannerOverlay, @NonNull ILiveIDResponseListener liveIDResponseListener)

  • Creates an object of LiveIDScannerHelper.
Parameters
contextContext: Application's context on top of which the Live ID scanning feature will start.
bidLiveIDScannerViewBIDScannerView: A custom view to be provided by application. This is generally used for UI customization.
scannerOverlayView: An overlay to be placed on top of BIDScannerView object.
liveIDResponseListenerILiveIDResponseListener: The block to execute after the response is received.

public LiveIDScannerHelper(@NonNull Context context, @NonNull BIDScannerView bidLiveIDScannerView, View scannerOverlay, @NonNull FacePresenceLevel facePresenceLevel, @NonNull ILiveIDResponseListener liveIDResponseListener)

Parameters
contextContext: Application's context on top of which the Live ID scanning feature will start.
bidLiveIDScannerViewBIDScannerView: A custom view to be provided by application. This is generally used for UI customization.
scannerOverlayView: An overlay to be placed on top of BIDScannerView object.
facePresenceLevelFacePresenceLevel: Can be set as LOW, MEDIUM or HIGH depending upon restrictions required for face detection.
liveIDResponseListenerILiveIDResponseListener: The block to execute after the response is received.

Method Summary​

Parameters
voidstartLiveIDScanning(@Nullable String mobileSessionID, @Nullable String mobileDocumentID)Starts the LiveID scanning. Liveness check performed using default dvcID set against License key.
voidstartLiveIDScanning(String dvcID, @Nullable String mobileSessionID, @Nullable String mobileDocumentID)Starts the LiveID scanning with the given dvcID (Document Verification Connector Identifier). Liveness check performed using given dvcID.
voidstartLiveIDScanning(boolean isWithoutLivenessCheck, @Nullable String mobileSessionID, @Nullable String mobileDocumentID)Starts the LiveID scanning. Liveness check performed using default dvcID set against License key.
If the Pass isWithoutLivenessCheck parameter is set to true, SDK will not perform liveness check on image.
voidstartLiveIDScanning(String dvcID, boolean isWithoutLivenessCheck, @Nullable String mobileSessionID, @Nullable String mobileDocumentID)Starts the LiveID scanning with the given dvcID (Document Verification Connector Identifier). Liveness check performed using given dvcID.
If the Pass isWithoutLivenessCheck parameter is set to true, SDK will not perform liveness check on image.
voidstopLiveIDScanningStops Live ID scanning.

Method Detail​

startLiveIDScanning​

public void startLiveIDScanning(@Nullable String mobileSessionID, @Nullable String mobileDocumentID)

  • Starts the LiveID scanning in default mode. Liveness check performed using default dvcID set against License key.
Parameters
mobileSessionID@Nullable String: Unique Session ID that can be used for event tracking or validation purposes.
mobileDocumentID@Nullable String: Unique Document ID that can be used for event tracking or validation purposes.

startLiveIDScanning​

public void startLiveIDScanning(String dvcID, @Nullable String mobileSessionID, @Nullable String mobileDocumentID)

  • Starts the LiveID scanning with the given dvcID (Document Verification Connector Identifier). Liveness check performed using give dvcID.
Parameters
dvcIDString: Document Verification Connector Identifier.
mobileSessionID@Nullable String: Unique Session ID that can be used for event tracking or validation purposes.
mobileDocumentID@Nullable String: Unique Document ID that can be used for event tracking or validation purposes.

startLiveIDScanning​

public void startLiveIDScanning(boolean isWithoutLivenessCheck, @Nullable String mobileSessionID, @Nullable String mobileDocumentID)

Starts the LiveID scanning. Liveness check performed using default dvcID set against License key. If the Pass isWithoutLivenessCheck is set to true, SDK will not perform liveness check on image

Parameter
isWithoutLivenessCheckboolean: Pass true so that SDK will not perform liveness check on image.
mobileSessionID@Nullable String: Unique Session ID that can be used for event tracking or validation purposes.
mobileDocumentID@Nullable String: Unique Document ID that can be used for event tracking or validation purposes.

startLiveIDScanning​

public void startLiveIDScanning(String dvcID, @Nullable String mobileSessionID, boolean isWithoutLivenessCheck, @Nullable String mobileDocumentID)

  • Starts the LiveID scanning with the given dvcID (Document Verification Connector Identifier). Liveness check performed using given dvcID.
  • If the Pass isWithoutLivenessCheck parameter is set to true, the Liveness check gets bypassed.
Parameter
dvcIDString: Document Verification Connector Identifier.
isWithoutLivenessCheckboolean: Pass true so that SDK will not perform liveness check on image.
mobileSessionID@Nullable String: Unique Session ID that can be used for event tracking or validation purposes.
mobileDocumentID@Nullable String: Unique Document ID that can be used for event tracking or validation purposes.

stopLiveIDScanning​

public void stopLiveIDScanning()

  • Stops Live ID scanning.

Interface Summary​

Parameter
ILiveIDResponseListenerCallback for event when LiveID is captured, face not found, face is not aligned, and multiple faces found. liveIdDidDetectErrorInScanning

Method Summary​

Parameters
voidonFaceFocusChanged(boolean isFocused, String message, ErrorManager.ErrorResponse errorResponse)Called when the user's face position changes within the scanner focus area.
voidonLiveIDCaptured(Bitmap liveIdBitmap, String token, String livenessResult, @Nullable String mobileSessionId, @Nullable String mobileDocumentId, ErrorManager.ErrorResponse error)Called when Live ID scanning is completed.
voidonLivenessCheckStarted()Called when the Live ID scanner has started liveness check.

onFaceFocusChanged​

default void onFaceFocusChanged(boolean isFocused, String message, ErrorManager.ErrorResponse errorResponse)

  • Called when the user's face position changes within the scanner focus area.
Parameter
isFocusedboolean: A flag that indicates if the user's face is in the focus area.
messageString:
- Please align the face in the center.
- Face is not found.
- Multiple faces found.
errorResponseAlong with messages.

onLiveIDCaptured​

void onLiveIDCaptured(Bitmap liveIdBitmap, String token, String livenessResult, ErrorManager.ErrorResponse error)

  • Called when Live ID scanning is completed.
Parameter
liveIdBitmapBitmap: An image of a person's face.
tokenString: A token that carries information about Live ID. This is used to verify if the user's Live ID is modified before storing it on the BlockID blockchain platform.
livenessResultString: JSON String result data of Liveness check
errorErrorManager.ErrorResponse: An object of ErrorResponse.
- FACE_IS_NOT_FOUND(130001, "Face is not found.")
- UNABLE_TO_DETECT_EYES(130002, "Unable to detect eyes.")
- UNABLE_TO_DETECT_LIPS(130003, "Unable to detect lips.")
- HEAD_TURNED_TOO_FAR(130004, "Head turned too far.")
- PLEASE_ALIGN_THE_FACE_IN_THE_CENTER(130005, "Please align the face in the center.")
- MULTIPLE_FACES_FOUND(130006, "Multiple faces found.")

onLivenessCheckStarted​

default void onLivenessCheckStarted()

  • Called when the Live ID scanner started the liveness check.