Skip to main content

Xamarin Onboarding Incode

Installation

The wrapper is available via Nuget package located in the Nuget folder of the project. Make sure to add this folder to the list of sources for Nuget packages.

Package should be installed in all your projects.

For Visual Studio for Windows, run this command

Install-Package Com.Incode.Onboarding

Setup

Make sure you call the following line in your code in the OnCreate() method on the MainActivity for Android, and on iOS in the FinishedLaunching method inside the AppDelegate

IncodeOnboarding.Current.Init(YOUR_URL, YOUR_API_KEY);

Url and ApiKey will be provided to you by Incode.

Adapt Info.plist by adding:

  • NSCameraUsageDescription. The SDK uses the camera in order to verify the identity of the customer, e.g. in ID scan, Selfie scan and so on.
  • NSLocationWhenInUseUsageDescription. The SDK uses the current user location in order to detect exact location for Geolocation step.
  • NSMicrophoneUsageDescription. The SDK uses microphone for performing a video call during Video Conference step or for doing speech recognition during Video Selfie.

Start Flow

SDK enables you to fully customize the experience of the flow, ie. by splitting Onboarding flow into multiple sections, adding your own custom screens between some of the steps etc. For creating a new Onboarding with multiple sections you should call the API as the following

// Create a new Onboarding configuration
var config = new OnboardingFlowConfiguration()
.AddIdScan(new IdScanParams(true, IdType.Id), result =>
{
if (result != null && result.Result == ResultCode.Success)
{
// Module completed, process result
}
})
.AddCurpValidation(result =>
{
if (result != null && result.Result == ResultCode.Success)
{
// Module completed, process result
}
})
.AddSelfieScan(new SelfieScanParams(true, true), result =>
{
if (result != null && result.Result == ResultCode.Success)
{
// Module completed, process result
}
})
.AddVideoSelfie(new VideoSelfieParams(), result =>
{
if (result != null && result.Result == ResultCode.Success)
{
// Module completed, process result
}
})
.AddDocumentScan(new DocumentScanParams(DocumentType.AddressStatement, true, false), result =>
{
if (result != null && result.Result == ResultCode.Success)
{
// Module completed, process result
}
})
.AddGeolocation(result =>
{
if (result != null && result.Result == ResultCode.Success)
{
// Module completed, process result
}
})
.AddFaceMatch(new FaceMatchParams(), result =>
{
if (result != null && result.Result == ResultCode.Success)
{
// Module completed, process result
}
})
.AddSignature(result =>
{
if (result != null && result.Result == ResultCode.Success)
{
// Module completed, process result
}
});

// Create a new Onboarding session
var session = await IncodeOnboarding.Current.CreateNewOnboardingSession();

if (session != null)
{
// Start the Onboarding section
var result = await IncodeOnboarding.Current.StartOnboardingSection(session.InterviewId, config);

if (result == ResultCode.Success)
{
// Section is completed, if we don't have new sections to start we should finish the onboarding session.
await IncodeOnboarding.Current.FinishOnboarding();
} else {
// Retry the section, show custom screen or start different section
}


}

Once all the sections are completed successfully and no new modules will be used for this session, its needed to finalize the session as shown in the example above:

// Onboarding is now finalized
await IncodeOnboarding.Current.FinishOnboarding();