Lookup Flow

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

The "Lookup 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.

Add the following code at the start-up of your application to initialize the SDK:

import 'package:uqudosdk_flutter/UqudoIdPlugin.dart';
import 'package:uqudosdk_flutter/uqudosdk_flutter.dart';
...
UqudoIdPlugin.init();
...

Use the below method for setting the locale of the application:

...
UqudoIdPlugin.setLocale(<your locale eg. fr, en etc.>);
...

To check if a document supports lookup and lookup + facial recognition you can use the below methods:

...
var isLookupSupported = await UqudoIdPlugin.isLookupSupported(DocumentType.NGA_DL);
var isLookupFacialRecognitionSupported = await UqudoIdPlugin.isLookupFacialRecognitionSupported(DocumentType.UAE_ID);
...

Below, you can find an example on how to initiate the lookup flow:

String result;
try {
  var lookupConfiguration = LookupBuilder()
	.setToken(token)
	.setDocumentType(DocumentType.NGA_DL)
	.enableFacialRecognition(
		new FacialRecognitionConfigurationBuilder()
			.setLookupMinimumMatchLevel(4)
			.build()
	)
	.enableBackgroundCheck(
		new BackgroundCheckConfigurationBuilder()
			.skipView()
			.build()
	)
	.build();
   result = await UqudoIdPlugin.lookup(lookupConfiguration);
} on PlatformException catch (exception) {
   result = exception.code;
   // {"code":"USER_CANCEL","message":"User canceled the Enrollment process","task":"LOOKUP"}
}

In order to evaluate all the possible options please refer to section Lookup Flow. The dart interface is the porting of the JAVA one. In addition you can check the dart files in the plugin ./lib folder or directly from your IDE.

If successful, the response is a JSON Web Signature (JWS). Please refer to section "SDK result" for further details.

In case of a failure, the callback returns the following object:

PropertyTypeOptionalDefaultDescription

code

String

No

None

message

String

Yes

null

Description of the error if any

task

String

Yes

null

Add the following event to enable the tracing mechanism as per the code shown below. Please refer to section Analytics for details.

import 'package:uqudosdk_flutter/UqudoIdPlugin.dart';

class _MyAppState extends State<MyApp> {

  @override
  void initState() {
    super.initState();
    UqudoIdPlugin.init();
    listenNativeEvent();
  }

  static const EventChannel _eventChannel =
      EventChannel('io.uqudo.sdk.id/trace');

  void listenNativeEvent() {
    _eventChannel.receiveBroadcastStream().listen(_onEvent, onError: _onError);
  }

  void _onEvent(Object? event) {
    if (event != null) {
      print("---TraceEvent=${event.toString()}");
    }
  }

  void _onError(Object error) {
    print('---TraceEvent error.');
  }
......

Last updated