# 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](/docs/kyc/uqudo-api/authorisation.md)" in this regard.

**Android**

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

```csharp
IO.Uqudo.Sdk.Core.UqudoSDK.Init(this);
```

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

```csharp
....
bool isLookupSupported = IO.Uqudo.Sdk.Core.Domain.Model.DocumentType.NgaVoterId.LookupSupported;
bool isLookupFacialRecognitionSupported = IO.Uqudo.Sdk.Core.Domain.Model.DocumentType.NgaVoterId.LookupFacialRecognitionSupported;
....
```

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

```csharp
var uqudoLookupBuilder = new IO.Uqudo.Sdk.Core.UqudoBuilder.Lookup();
bool isLookupFacialRecognitionSupported = IO.Uqudo.Sdk.Core.Domain.Model.DocumentType.NgaVoterId.LookupFacialRecognitionSupported;

if (isLookupFacialRecognitionSupported)
{
    var facialRecognitionConfigurationBuilder = new IO.Uqudo.Sdk.Core.Builder.FacialRecognitionConfigurationBuilder();
    facialRecognitionConfigurationBuilder.SetLookupMinimumMatchLevel(4);
    uqudoLookupBuilder.EnableFacialRecognition(facialRecognitionConfigurationBuilder.Build());
}

var backgroundCheck = new IO.Uqudo.Sdk.Core.Builder.BackgroundCheckConfigurationBuilder();
backgroundCheck.SetBackgroundCheckType(IO.Uqudo.Sdk.Core.Domain.Model.BackgroundCheckType.Rdc);
uqudoLookupBuilder.EnableBackgroundCheck(backgroundCheck.Build());
uqudoLookupBuilder.SetToken(token);
uqudoLookupBuilder.SetDocumentType(IO.Uqudo.Sdk.Core.Domain.Model.DocumentType.NgaNin);

StartActivityForResult(uqudoLookupBuilder.Build(this), 101);

```

In order to evaluate all the possible options please refer to section [Lookup Flow](/docs/kyc/uqudo-sdk/integration/android/lookup-flow.md). The C# interface is the porting of the JAVA one.

**iOS**

To initialize the SDK, within your AppDelegate class under FinishedLaunching instantiate UQBuilderController() as the following example:

```csharp
using UqudoSDK;
...
{
[Register("AppDelegate")]
public class AppDelegate : UIResponder, IUIApplicationDelegate
...
[Export("application:didFinishLaunchingWithOptions:")]
public bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
  new UQBuilderController();
  return true;
}
```

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

```csharp
....
UQDocumentConfig documentConfig = new UQDocumentConfig((int)DocumentTypeID.NgaNin);
bool isLookupSupported = documentConfig.IsLookupFacialRecognitionSupported;
bool isLookupFacialRecognitionSupported = documentConfig.IsLookupSupported;
...
```

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

```csharp
using UqudoSDK;
...
var builderController = UQBuilderController.DefaultBuilder();
builderController.AppViewController = this;
builderController.Delegate = new UqudoBuilderControllerDelegate();
var lookupBuilder = new UQLookupBuilder();
lookupBuilder.DocumentType = DocumentTypeID.NgaVoterId;

var documentConfig = new UQDocumentConfig((int)DocumentTypeID.NgaVoterId);
bool isLookupFacialRecognitionSupported = documentConfig.IsLookupFacialRecognitionSupported;
if (isLookupFacialRecognitionSupported)
{
    lookupBuilder.EnableFacialRecognition = true;
    lookupBuilder.FacialRecognitionMinimumMatchLevel = 4;
}

lookupBuilder.AuthorizationToken = token;

builderController.SetLookup(lookupBuilder);
builderController.PerformLookup();
....
```

UqudoBuilderControllerDelegate.cs

```csharp
using UqudoSDK;
...

namespace <Your Project Namespace>
{
	public class UqudoBuilderControllerDelegate : UQBuilderControllerDelegate
	{
	
    	public UqudoBuilderControllerDelegate()
    	{
    	}
    
        public override void DidLookupFlowCompleteWithInfo(string info)
        {
            System.Diagnostics.Debug.WriteLine(info);
        }
    
        public override void DidLookupFlowIncompleteWithStatus(UQSessionStatus status)
        {
            System.Diagnostics.Debug.WriteLine(status);
        }
    
	}
}
```

In order to evaluate all the possible options please refer to section [Lookup Flow](/docs/kyc/uqudo-sdk/integration/ios/lookup-flow.md). The C# interface is the binding to the Objective-C one.

**Android and iOS**

To handle the result check the Android documentation "[Handling the Result](/docs/kyc/uqudo-sdk/integration/android/lookup-flow.md#handling-the-result)" for Android and the iOS documentation "[Handling the Result](/docs/kyc/uqudo-sdk/integration/ios/lookup-flow.md#handling-the-result)" for iOS.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.uqudo.com/docs/kyc/uqudo-sdk/integration/xamarin/lookup-flow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
