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
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.
| Name | Type | Description |
|---|---|---|
FaceRecognitionKey | String | Unique identifier of the face photo stored in QI Tech. Important: Store this value to send in validation APIs (e.g.: Onboarding API). |
DeviceScanSessionId | String | Unique identifier of the device scan session performed internally. |
ZaigIosFaceRecognitionControllerError
The ZaigIosFaceRecognitionControllerError class is triggered when an error occurs that leads to SDK termination.
Starting from version 5.0.0, the error structure has been reformulated to provide more detailed and diagnostic information.
Main changes:
- New error types:
InvalidToken(replacesInvalidMobileToken) - New available properties:
status_code: HTTP error codereason: Error reason identifierdescription: 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
| Error | Status Code | Description |
|---|---|---|
InvalidToken | 401 | Authentication token expired or invalid (replaces InvalidMobileToken) |
Versions prior to 5.0.0
| Error Class | Description |
|---|---|
InvalidMobileToken | MobileToken sent in configurations is invalid (replaced by InvalidToken in v5.0.0+) |
MissingPermission | One of the necessary permissions was not granted |
NetworkFailure | Loss of internet connection during validation |
ServerFailure | Error response from QI Tech server |
MissingStorage | Insufficient storage space |
LowImageQuality | Image quality insufficient for validation |