Lookup Flow

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

The "Lookp Flow" it's the same as the "Enrollment Flow" with the only difference that the first step is not the automatic scanning of a document through the camera phone but the user is asked to manually type in some information of the document that can be used to perform the lookup on the government database. Only one document at the time is supported. Other features like facial recognition and background check can be enabled in the same way as per the "Enrollment Flow". Note that not all the documents are supported.

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 "Lookup Flow". The example below assumes that you have already initialised the SDK:

Objective-C
UQBuilderController *builderController = [UQBuilderController defaultBuilder];
builderController.delegate = self;
builderController.appViewController = self;
//
UQLookupBuilder *lookupBuilder = [[UQLookupBuilder alloc] init];
lookupBuilder.authorizationToken = authorizationToken;
[lookupBuilder setDocumentType:NGA_DL];
//
UQFacialRecognitionConfig *frConfig = [[UQFacialRecognitionConfig alloc] init];
frConfig.enableFacialRecognition = YES;
frConfig.minimumMatchLevel = 4;
lookupBuilder.facialRecognitionConfig = frConfig;
//
[lookupBuilder enableBackgroundCheck:YES type:RDC monitoring:NO skipView:YES];
//
[builderController setLookup:lookupBuilder];
[builderController performLookup];
Swift
let builderController = UQBuilderController.defaultBuilder()
builderController.delegate = self
builderController.appViewController = self
//
let lookupBuilder = UQLookupBuilder()
lookupBuilder.authorizationToken = authorizationToken
lookupBuilder.setDocumentType(NGA_DL)
//
let frConfig = UQFacialRecognitionConfig()
frConfig.enableFacialRecognition = true
frConfig.minimumMatchLevel = 4
lookupBuilder.facialRecognitionConfig = frConfig
//
lookupBuilder.enableBackgroundCheck(true, type: RDC, monitoring: false, skipView: true)
//
builderController.setLookup(lookupBuilder)
builderController.performLookup()

Uqudo Lookup 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:NGA_DL];
[documentConfig isLookupSupported]
Swift
let documentConfig = UQDocumentConfig(documentType: NGA_DL)
document.isLookupSupported()

Configuration options provided in the Uqudo Lookup builder are:

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:NGA_DL];
[documentConfig isLookupFacialRecognitionSupported]
Swift
let documentConfig = UQDocumentConfig(documentType: NGA_DL)
document.isLookupFacialRecognitionSupported()

By default the facial recognition is disabled. You need to enable Facial Recognition explicitly. See the example below:

Objective-C
UQFacialRecognitionConfig *config = [[UQFacialRecognitionConfig alloc] init];
config.enableFacialRecognition = YES;
config.enrollFace = NO;
config.minimumMatchLevel = 4;
config.maxAttempts = 3;
config.allowClosedEyes = NO;
Swift
let config = UQFacialRecognitionConfig()
config.enableFacialRecognition = true
config.enrollFace = false
config.minimumMatchLevel = 4
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

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

Objective-C
[lookupBuilder enableBackgroundCheck:YES type:RDC monitoring:NO skipView:YES];
Swift
lookupBuilder.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)didLookupFlowCompleteWithInfo:(NSString *)info {}
Swift
func didLookupFlowComplete(withInfo info: String) {}

A failure scenario can be handled with the following method:

Objective-C
- (void)didLookupFlowIncompleteWithStatus:(UQSessionStatus *)status {}
Swift
func didLookupFlowIncomplete(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_OTP_TOO_MANY_ATTEMPTS = Some documents require an OTP step. The error is trigger if for example the OTP expires multiple times and the user is not moving forward

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

statusTask contains the following codes:

  • LOOKUP = The lookup 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 Lookup Builder Configuration for details.

Last updated