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:

Property
Type
Optional
Default
Description

authorizationToken

String

No

null

nonce

String

(max size 64 chars)

Yes

null

Nonce provided by the customer mobile application when the SDK is initiated. It is useful to make sure the process has been initiated by the customer mobile application. It should be generated server side.

setSessionID(sessionId)

String

(UUID v4)

Yes

Auto generated

Note: make sure to create always a new session id when you trigger the SDK flow

enableFacialRecognition

Boolean

Yes

false

enableBackgroundCheck(isDisableConsent, backgroundCheckType,

monitoring,

skipView)

Boolean, Integer,

Boolean,

Boolean

Yes

None

setDocumentType(documentType)

Integer

No

None

Set the document type

returnDataForIncompleteSession

Boolean

Yes

false

setAppearanceMode()

AppearanceMode

No

SYSTEM

Note: this method is exposed by the UQBuilderController object.

Set the appearance mode for the SDK. The following options are available:

  • SYSTEM: the SDK checks the OS setting for light or dark mode

  • LIGHT: force the light mode

  • DARK: force the dark mode

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:

Property
Type
Optional
Default
Description

minimumMatchLevel

Integer

Yes

None

Defines the minimum match level that the facial recognition has to meet for pictures from the government database

maxAttempts

Int

Yes

3

Set the max failed facial recognition attempts before dropping the session. Note: only values between 1 and 3 are taken into consideration.

allowClosedEyes

bool

Yes

false

Allows to have closed eyes during facial recognition.

enableOneToNVerification

bool

Yes

false

Once activated, following a successful facial recognition (confirming liveness and matching the face), the system initiates a search for the user's selfie within your tenant. If the selfie is not found, it is added, and the indexed facial features are stored in the database. The SDK result includes a unique ID in the face object, along with an indication of whether there was a match with a previously onboarded selfie. It's essential to store this unique ID in your system alongside the user's record, facilitating future searches for users with the same ID. Please be aware that this option requires a specific permission, otherwise, it will be disregarded

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:

Property
Type
Optional
Default
Description

isDisableConsent

Boolean

No

false

Disable consent option for the user

backgroundCheckType

Integer

No

RDC

Sets the background check type

enableMonitoring

Boolean

Yes

false

Enable continuous monitoring

skipView

Boolean

Yes

false

If enabled, the step will be skipped, and the SDK will trigger the background check without any user interaction.

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