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.
- 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 | |
|---|---|
| bidScannerView | BIDScannerView: A custom view to be provided by the application. This is generally used for UI customization. |
| overlayFrame | CGRect: An overlay rect which is placed on top of the BIDScannerView object. |
| liveIdResponseDelegate | LiveIDResponseDelegate: The block to execute after the response is received. |
Method Summary
| Parameters | ||
|---|---|---|
| void | startLiveIDScanning(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 |
| void | stopLiveIDScanning | Stops 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.
| Parameter | Description |
|---|---|
| isWithoutLivenessCheck | Bool: (Optional) Pass true to skip the liveness check on the image. |
| dvcID | String: (Optional) Document Verification Connector Identifier. |
| mobileSessionId | String: (Optional) Unique Session ID that can be used for event tracking or validation purposes. |
| mobileDocumentId | String: (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 | |
|---|---|
| LiveIDResponseDelegate | Callback for the event when Live ID is captured, face expressions are changed, or face is out of focus. |
Method Summary
| Parameters | ||
|---|---|---|
| void | faceLivenessCheckStarted() | Called when scanner has started liveness check. This protocol method is Optional. |
| void | focusOnFaceChanged(isFocused: Bool?, message: String?) | Called when if the user's face focus changes within the scanner focus area. This protocol method is Optional. |
| void | liveIdDetectionCompleted(_ liveIdImage: UIImage?, signatureToken: String?, livenessResult: String?, mobileSessionId: String?, mobileDocumentId: String?, error: ErrorResponse?) | Called when Live ID scanning is completed. This protocol method is Required. |
| void | liveIdDidDetectErrorInScanning(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 | ||
|---|---|---|
| isFocused | boolean | A flag that indicates if the user's face is in the focus area. |
| message | String | Message: - 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 | ||
|---|---|---|
| liveIdImage | UIImage | An image of person's face. |
| signatureToken | String | A 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. |
| livenessResult | String | JSON String result data of Liveness check. |
| mobileSessionId | String | (Optional) Unique Session ID |
| mobileDocumentId | String | (Optional) Unique Document ID |
| error | ErrorResponse | An object of ErrorResponse. |
liveIdDidDetectErrorInScanning
func liveIdDidDetectErrorInScanning(error: ErrorResponse?)
- Called when an error occurs during Live ID scanning.
| Parameters | ||
|---|---|---|
| error | ErrorResponse | An error object. |