Skip to main content

Collecting SDK Returns

To obtain SDK responses, you must implement the ZaigIosFaceRecognitionControllerDelegate delegate in your controller, as shown in the example on the side.

class ViewController: UIViewController, ZaigIosFaceRecognitionControllerDelegate {

// Do something if QI Tech FaceRecognition's SDK succesfully collected document picture
func zaigIosFaceRecognitionController(_ faceRecognitionViewController: ZaigIosFaceRecognitionController, didFinishWithResults response: ZaigIosFaceRecognitionControllerResponse) {

}

// Do something if QI Tech FaceRecognition's SDK found any error when collecting document picture
func zaigIosFaceRecognitionController(_ faceRecognitionViewController: ZaigIosFaceRecognitionController, didFailWithError error: ZaigIosFaceRecognitionControllerError) {

}

// Do something if the user canceled the picture collection on any steps
func zaigIosFaceRecognitionControllerDidCancel(_ faceRecognitionViewController: ZaigIosFaceRecognitionController) {

}
}

ZaigIosFaceRecognitionControllerResponse

The ZaigIosFaceRecognitionControllerResponse class is used so you can receive the response from QI Tech's SDK.

In the table below you will find the details of all properties of this class:

Properties

Warning:

Device Scan Integration Starting from version 6.1.0, the Face Recognition service will automatically perform an internal call to Device Scan. With this, the success response will include the DeviceScanSessionId field. This key identifies the device scan session performed internally and can be used in an integrated manner in other QI Tech ecosystem services.

NameTypeDescription
FaceRecognitionKeyStringUnique identifier of the face photo stored in QI Tech. Important: Store this value to send in validation APIs (e.g.: Onboarding API).
DeviceScanSessionIdStringUnique identifier of the device scan session performed internally.

ZaigIosFaceRecognitionControllerError

The ZaigIosFaceRecognitionControllerError class is triggered when an error occurs that leads to SDK termination.

Important Warning!

Starting from version 5.0.0, the error structure has been reformulated to provide more detailed and diagnostic information.

Main changes:

  1. New error types: InvalidToken (replaces InvalidMobileToken)
  2. New available properties:
    • status_code: HTTP error code
    • reason: Error reason identifier
    • description: Detailed error description

Error Structure (SDK 5.0.0+)

Example: InvalidToken

{
status_code: 401,
reason: "INVALID_TOKEN",
description: "Authentication token expired or invalid"
}

Error Types

SDK 5.0.0 and later

ErrorStatus CodeDescription
InvalidToken401Authentication token expired or invalid (replaces InvalidMobileToken)

Versions prior to 5.0.0

Error ClassDescription
InvalidMobileTokenMobileToken sent in configurations is invalid (replaced by InvalidToken in v5.0.0+)
MissingPermissionOne of the necessary permissions was not granted
NetworkFailureLoss of internet connection during validation
ServerFailureError response from QI Tech server
MissingStorageInsufficient storage space
LowImageQualityImage quality insufficient for validation