ScreenlyyIDDocs
Docs › Integrations

Mobile app

The mobile integration is customisable and works on any mobile platform with only a few lines of code. It uses a WebView to hand off document and selfie capture to ScreenlyyID from inside your app, so you only show the screens you need and users never leave your app.

Follow the implementation steps below, and see the iOS sample app. It is written for iOS, but the concept works on any platform. Its README describes the same four steps.

Implementation steps#

Step 1: Create an instance#

Call the Instance API. The response contains a valid webEnrolmentUrl.

Step 2: Open a WebView#

Start a WebView in your app and load the webEnrolmentUrl returned by the Instance API. It looks like this:

https://app.screenlyyid.com/idv/6a0e5cb3-900c-41ca-ba84-08a08c6edff6

This starts the ScreenlyyID document enrolment process.

The skipIntro parameter#

Add skipIntro=true to the URL to skip the intro screen and go straight to image capture:

https://app.screenlyyid.com/idv/6a0e5cb3-900c-41ca-ba84-08a08c6edff6?skipIntro=true

Step 3: Listen for events#

Listen for postMessage events from the WebView and act on them. Events use this format:

JSON
{
  "eventName": "",
  "isError": false,
  "error": ""
}

The current events are:

EventMeaning
IDV_SESSION_COMPLETEFired as soon as the identity document and selfie have been collected.
ERRORA fatal, non-recoverable error occurred while processing the images (isError is true and error describes it). The SDK handles most errors itself, but you may want to listen for this event and restart the process or continue your onboarding flow.

If you only use the hosted document capture for identity verification (document collection, face match and liveness), it is safe to close the WebView and continue your app flow once IDV_SESSION_COMPLETE is received.

Step 4: Get the results from your back end#

When your app receives IDV_SESSION_COMPLETE, call these two APIs from your back end, not from the app, so your API key stays secret. Send your x-api-key, and the x-correlation-id you got from the Instance API in Step 1:

  1. Get hosted SDK document data (GET /api/v1/document/data) returns the ID data read from the document (OCR and MRZ fields).
  2. Get hosted SDK decision result (GET /api/v1/document/result) returns the overall decision result for the scan, including the document checks, liveness and face match.

For more on interpreting the results, see Data retrieval and Understanding results.

You can also review every verification in the dashboard: sign in and open Verifications.