Enrolment Flow

In order to use our SDK you need an authorization token. Please check our API "Authorisation" in this regard.

The Uqudo SDK provides a builder class to initiate the "Enrollment Flow". The example below assumes that you have already initialised the SDK:

Objective-C
UQBuilderController *builderController = [UQBuilderController defaultBuilder];
builderController.delegate = self;
builderController.appViewController = self;
//
UQEnrollmentBuilder *enrollmentBuilder = [[UQEnrollmentBuilder alloc] init];
enrollmentBuilder.authorizationToken = authorizationToken;
//
UQFacialRecognitionConfig *frConfig = [[UQFacialRecognitionConfig alloc] init];
frConfig.enableFacialRecognition = YES;
enrollmentBuilder.facialRecognitionConfig = frConfig;
//
UQDocumentConfig *documentConfig = [[UQDocumentConfig alloc] initWithDocumentType:PASSPORT];
//
UQReadingConfig *readingConfig = [[UQReadingConfig alloc] init];
readingConfig.enableReading = YES;
[readingConfig forceReadingIfSupported:YES];
documentConfig.reading = readingConfig;
//
[enrollmentBuilder add:documentConfig];
//
[builderController setEnrollment:enrollmentBuilder];
[builderController performEnrollment];
Swift
let uqudoBuilder = UQBuilderController.defaultBuilder()
uqudoBuilder.delegate = self
uqudoBuilder.appViewController = self
//
let enrollmentBuilder = UQEnrollmentBuilder()
enrollmentBuilder.authorizationToken = authorizationToken
//
let frConfig = UQFacialRecognitionConfig()
frConfig.enableFacialRecognition = true
enrollmentBuilder.facialRecognitionConfig = frConfig
//
let passport = UQDocumentConfig(documentType: PASSPORT.rawValue)
//
let readingConfig = UQReadingConfig()
readingConfig.enableReading = true
readingConfig.forceReadingIfSupported(true)
passport.reading = readingConfig
//
enrollmentBuilder.add(passport)
//
uqudoBuilder.setEnrollment(enrollmentBuilder)
uqudoBuilder.performEnrollment()

Uqudo Enrollment Builder Configuration

In order to check if the document type supports the "Lookup Flow" you can use the following method:

Objective-C
UQDocumentConfig *documentConfig = [[UQDocumentConfig alloc] initWithDocumentType:PASSPORT];
[documentConfig isEnrollmentSupported]
Swift
let documentConfig = UQDocumentConfig(documentType: PASSPORT)
document.isEnrollmentSupported()

Please refer to the Scan API for supported Document Types.

Configuration options provided in the Uqudo Enrollment builder are:

Document Configuration

Objective-C
UQDocumentConfig *passport = [[UQDocumentConfig alloc] initWithDocumentType:PASSPORT];
passport.disableExpiryValidation = NO;
passport.enableAgeVerification = -1;
passport.scan = <Scan Config Object>;
passport.reading = <Reading Config Object>;
Swift
let passport = UQDocumentConfig(documentType: PASSPORT.rawValue)
passport.disableExpiryValidation = false
passport.enableAgeVerification = -1
passport.scan = <Scan Config Object>
passport.reading = <Reading Config Object>

See the options described below:

Scan Configuration

Objective-C
UQScanConfig *scanConfig = [[UQScanConfig alloc] init];
scanConfig.disableHelpPage = NO;
scanConfig.faceMinimumMatchLevel = 2;
[scanConfig enableScanReview:NO backSide:NO];
scanConfig.enableUpload = NO;
Swift
let scanConfig = UQScanConfig()
scanConfig.disableHelpPage = false
scanConfig.faceMinimumMatchLevel = 2
scanConfig.enableScanReview(false, false)
scanConfig.enableUpload = false

See the options described below:

Read Configuration

In order to check if the document type supports the reading step you can use the following method:

Objective-C
UQDocumentConfig *documentConfig = [[UQDocumentConfig alloc] initWithDocumentType:PASSPORT];
[documentConfig isSupportReading]
Swift
let documentConfig = UQDocumentConfig(documentType: PASSPORT)
document.isSupportReading()
Objective-C
UQReadingConfig *readingConfig = [[UQReadingConfig alloc] init];
readingConfig.enableReading = YES;
readingConfig.faceMinimumMatchLevel = 3;
[readingConfig forceReading:NO];
readConfig.forceReadingTimeout = -1;
Swift
let readingConfig = UQReadingConfig()
readingConfig.enableReading = true
readingConfig.faceMinimumMatchLevel = 3
readingConfig.forceReading(false)
readingConfig.forceReadingTimeout(-1)

See the options described below:

Facial Recognition Configuration

In order to check if the document type supports facial recognition you can use the following method:

Objective-C
UQDocumentConfig *documentConfig = [[UQDocumentConfig alloc] initWithDocumentType:PASSPORT];
[documentConfig isSupportFaceRecognition]
Swift
let documentConfig = UQDocumentConfig(documentType: PASSPORT)
document.isSupportFaceRecognition()

Note: By default the facial recognition is disabled. You will have to enable facial recognition explicitly as per the below example:

Objective-C
UQFacialRecognitionConfig *config = [[UQFacialRecognitionConfig alloc] init];
config.enableFacialRecognition = YES;
config.scanMinimumMatchLevel = 2;
config.readMinimumMatchLevel = 3;
config.maxAttempts = 3;
config.allowClosedEyes = NO;
Swift
let config = UQFacialRecognitionConfig()
config.enableFacialRecognition = true
config.scanMinimumMatchLevel = 2
config.readMinimumMatchLevel = 3
config.maxAttempts = 3
config.allowClosedEyes = false

Facial Recognition configuration options available:

Background Check Configuration

Note: This feature requires an additional permission and must be explicitly requested

Note: By default the Background Check is disabled. You need to enable Background Check explicitly. See the example below:

Objective-C
[enrollmentBuilder enableBackgroundCheck:YES type:RDC monitoring:NO skipView:YES];
Swift
enrollmentBuilder.enableBackgroundCheck(true, type: RDC, monitoring: false, skipView: true)

Background Check configuration options available:

Handling Exceptions

The Uqudo SDK will throw certain exceptions which need to be handled by the application. The Exceptions are:

  1. IllegalStateException - e.g. enabling the "Lookup Flow" for a document that doesn’t support it or because facial recognition is enabled and the documcent doesn't support it or because of some required configuration missing

  2. UnsupportedDeviceException - e.g. the device is rooted

Handling the Result

The enrollment result will be available to the builder delegate (the class that initiates the SDK has to extends UQBuilderControllerDelegate) if the operation succeeds and you get the result with the following method. See "SDK result" for the details about the JWS string:

Objective-C
- (void)didEnrollmentCompleteWithInfo:(NSString *)info {}
Swift
func didEnrollmentComplete(withInfo info: String) {}

A failure scenario can be handled with the following method:

Objective-C
- (void)didEnrollmentIncompleteWithStatus:(UQSessionStatus *)status {}
Swift
func didEnrollmentIncomplete(with status: UQSessionStatus) {}

See the details about the UQSessionStatus below.

Session Status Handling

The UQSessionStatus is used to identify the status of the enrollment task. The object contains the following properties:

@property (nonatomic, assign) NSInteger statusCode;
@property (nonatomic, assign) NSInteger statusTask;
@property (nonatomic, strong) NSString *message;
@property (nonatomic, strong) NSString *data;

statusCode contains the following error codes:

  • USER_CANCEL = User cancel the operation

  • SESSION_EXPIRED = Session expired or not found

  • UNEXPECTED_ERROR = Something went wrong. In the message the details of the error

  • SESSION_INVALIDATED_CHIP_VALIDATION_FAILED = Session gets invalidated because the CHIP validation of the card fails, and the reading step is forced by configuration

  • SESSION_INVALIDATED_READING_NOT_SUPPORTED = Session gets invalidated because the document doesn’t support reading (e.g. no chip available) and the reading step is forced by configuration

  • SESSION_INVALIDATED_FACE_RECOGNITION_TOO_MANY_ATTEMPTS = Session gets invalidated because of too many failed facial recognition attempts

  • SESSION_INVALIDATED_CAMERA_NOT_AVAILABLE = Session gets invalidated because the camera is not available

  • SESSION_INVALIDATED_CAMERA_PERMISSION_NOT_GRANTED = Session gets invalidated because camera the end user denies camera access

statusTask contains the following codes:

  • SCAN = The scanning task

  • READING = The NFC reading task

  • FACE = The facial recognition task

  • BACKGROUND_CHECK = The background check task (only if skipView() is not enabled)

message contains the details of the status code

data as String that contains the JWS object with the partial data of an incomplete KYC session. Returning the partial data for an incomplete KYC session is disabled by default, please see Enrollment Builder Configuration for details.

Last updated