NFC / Reading Flow

The "NFC/Reading Flow" is essentially the same as the "Enrollment Flow," with the only difference being the initial step. Instead of automatically scanning a document using the phone's camera, the process begins with the NFC/Reading step. To proceed, you must provide the necessary data to unlock the chip. Only one document can be processed at a time. Additional features, such as facial recognition and background checks, can be enabled just as they are in the "Enrollment 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 "NFC / Reading Flow". The example below assumes that you have already initialised the SDK:

Objective-C
UQBuilderController *builderController = [UQBuilderController defaultBuilder];
builderController.delegate = self;
builderController.appViewController = self;
//
UQReadingBuilder *readingBuilder = [[UQReadingBuilder alloc] init];
readingBuilder.authorizationToken = authorizationToken;
readingBuilder.sessionID = sessionID;
readingBuilder.userIdentifier = userIdentifier;
readingBuilder.nonce = nonce;
//
UQFacialRecognitionConfig *facialRecognitionConfig = [[UQFacialRecognitionConfig alloc] init];
facialRecognitionConfig.enableFacialRecognition = YES;
readingBuilder.facialRecognitionConfig = facialRecognitionConfig;
//
[readingBuilder enableBackgroundCheck:YES type:RDC monitoring:NO skipView:YES];
//
readingBuilder.documentType = UAE_ID;
readingBuilder.documentNumber = @"111111111";
readingBuilder.dateOfBirth = @"1980-08-25";
readingBuilder.dateOfExpiry = @"2022-03-06";
//
[builderController setReading:readingBuilder];
[builderController performReading];
Swift
let builderController = UQBuilderController.defaultBuilder()
builderController.delegate = self
builderController.appViewController = self
//
let readingBuilder = UQReadingBuilder()
readingBuilder.authorizationToken = authorizationToken
readingBuilder.sessionID = sessionID
readingBuilder.userIdentifier = userIdentifier
readingBuilder.nonce = nonce
//
let frConfig = UQFacialRecognitionConfig()
frConfig.enableFacialRecognition = true
readingBuilder.facialRecognitionConfig = frConfig
//
readingBuilder.enableBackgroundCheck(true, type: RDC, monitoring: false, skipView: true)
//
readingBuilder.documentType = UAE_ID;
readingBuilder.documentNumber = "111111111";
readingBuilder.dateOfBirth = "1980-08-25";
readingBuilder.dateOfExpiry = "2022-03-06";
//
builderController.setReading(readingBuilder)
builderController.performReading()

Reading Builder Configuration

Configuration options provided in the Uqudo Reading 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

Enable facial recognition. See Facial Recognition Configuration for additional configurations

enableBackgroundCheck(isDisableConsent, backgroundCheckType,

monitoring,

skipView)

Boolean, Integer,

Boolean,

Boolean

Yes

None

Enable background check. See Background Check Configuration for details

setDocumentType(documentType)

Integer

No

None

Set the document type

returnDataForIncompleteSession

Boolean

Yes

false

When enabled, if the user or the SDK drops the session before completion, the SDK will return the partial data together with the SessionStatus object (see Session Status Handling). Please note that you can expect some data only if the user passes at least the reading step

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

documentNumber

String

No

None

Set the document number used to unlock the chip

dateOfBirth

String

No

None

Set the date of birth used to unlock the chip. The format must be "yyyy-MM-dd"

dateOfExpiry

String

No

None

Set the date of expiry used to unlock the chip. The format must be "yyyy-MM-dd"

mrz

String

Yes

None

Set the MRZ. TD1 and TD3 MRZ type are supported. Every MRZ line must be separated by a new line char. If the MRZ is set, it takes priority and the other information are ignored.

Facial Recognition Configuration

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;
Swift
let config = UQFacialRecognitionConfig()
config.enableFacialRecognition = true

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

enableActiveLiveness

Bool

Yes

False

Enable active liveness when performing facial recognition. There are three gestures:

  • LivenessGesture.FACE_MOVE

  • LivenessGesture.FACE_TILT

  • LivenessGesture.FACE_TURN

Every gesture has two actions associated resulting in a total of six possible actions (move closer, move further, tilt right, tilt left, turn right, turn left). During verification, the SDK will randomly prompt the user to perform one of these actions to continue. The configuration allows you to disable one gesture type (see below), reducing the pool to four actions. Warning: We recommend enabling this feature only if required for regulatory or compliance purposes, as it may significantly impact user conversion rates.

disableLivenessGesture

LivenessGesture

Yes

None

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
[readingBuilder enableBackgroundCheck:YES type:RDC monitoring:NO skipView:YES];
Swift
readingBuilder.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 "NFC / Reading 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

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)didReadingCompleteWithInfo:(NSString *)info {}
Swift
func didReadingComplete(withInfo info: String) {}

A failure scenario can be handled with the following method:

Objective-C
- (void)didReadingIncompleteWithStatus:(UQSessionStatus *)status {}
Swift
func didReadingIncomplete(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 canceled the enrollment process

  • SESSION_EXPIRED = Session expired or not found

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

  • SESSION_INVALIDATED_READING_INVALID_DOCUMENT = Session gets invalidated because the digital signature validation fails after reading the data in the chip

  • SESSION_INVALIDATED_CHIP_VALIDATION_FAILED = Session gets invalidated because chip authentication fails (e.g. chip authentication for passports)

  • SESSION_INVALIDATED_READING_AUTHENTICATION_FAILED = Session gets invalidated because the information provided to unlock the chip are incorrect

  • 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 the end user denied camera permission

statusTask contains the following codes:

  • 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 Reading Builder Configuration for details.

Last updated

Was this helpful?