Skip to main content

WebView · Fallback

Didit verification in a mobile WebView

A WebView is a browser window inside a mobile app. Use it only when your platform has no native SDK. It runs the web flow, so it cannot read NFC chips.

$npx expo install react-native-webview

When

When to use a WebView

Only in three cases. On iOS, Android, React Native and Flutter, use the native SDK.

No native SDK for your platformSuch as Xamarin, Cordova or another small framework.
A quick prototypeA proof of concept before you add the native SDK.
A bridge from webA temporary step while you move a web app to native.
PlatformUse thisWebView
iOS
Not recommended
Android
Not recommended
React Native
Not recommended
Flutter
Not recommended
Other platforms
No native SDK
Use a WebView as the fallback

A native SDK reads NFC chips, tunes the camera and uses the biometrics of the phone. A WebView loses all three. NFC means reading the chip in a passport or ID card with the phone.

Setup

Five settings the WebView needs

The flow uses the camera, so the WebView must allow media and JavaScript.

SettingWhy
User agent
Required. Set a generic mobile user agent, so the camera and the screens work.
mediaPlaybackRequiresUserGesture
Set it to false, so the camera can start on its own.
allowsInlineMediaPlayback
Stops fullscreen video on iOS.
javaScriptEnabled
Required. The flow needs JavaScript.
domStorageEnabled
Session storage on Android.

The user agent from the docs

Mozilla/5.0 (Linux; Android 10; Mobile) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36
curl -X POST https://verification.didit.me/v3/session/ \  -H "x-api-key: $DIDIT_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "workflow_id": "your-workflow-id",    "vendor_data": "user-123",    "callback": "https://yourapp.com/callback",    "callback_method": "both"  }'

Load the url from the create session response. Never build it from session_token by hand. The camera permission must also be granted in the phone settings.

Callback

Catch the callback

When the user finishes, the WebView goes to your callback URL with two values.

verificationSessionIdThe ID of the session.
statusApproved, Declined or In Review.
callback_methodSet it to both if the callback does not fire. It sends the redirect to both sides of a flow that moves between devices.
Custom schemeA callback such as myapp://verification-complete opens your app as a deep link.

The WebView lands on

https://yourapp.com/callback?verificationSessionId=abc123&status=Approved

Your app watches the navigation and closes the WebView when the URL starts with your callback. The result in the URL is for your screen only. The signed decision reaches your server by webhook.

Questions

Questions about the WebView

Should I use a WebView or a native SDK?
Use a native SDK on iOS, Android, React Native and Flutter. A WebView is a fallback for platforms with no native SDK, for a quick prototype or as a temporary bridge from web.
Does NFC work in a WebView?
No. A WebView runs the web flow, so it cannot read the chip in a passport or ID card. The native SDKs can.
Why is the camera not working in my WebView?
Set mediaPlaybackRequiresUserGesture to false, grant the camera permission in the phone settings and set the generic mobile user agent from the docs.
Why does the callback not fire?
Check that the callback URL matches the one you sent when you created the session and that your navigation listener is set. Then try callback_method set to both.
Which URL do I load in the WebView?
Load the url field returned by POST /v3/session/ on your backend. It embeds the 12-character session_token, not the session_id, for example https://verify.didit.me/session/3FaJ9wLqX2Mz. Didit's docs say never to build the URL from session_token by hand.
Which WebView packages do the examples use?
For React Native, the Didit example uses react-native-webview, installed with npm or npx expo install. For Flutter, it uses webview_flutter with webview_flutter_wkwebview and webview_flutter_android. Didit publishes demo repositories for both, but its native SDKs remain the recommended path.
Can I use a custom URL scheme as the callback?
Yes. Didit recommends a custom URL scheme such as myapp://verification-complete as your callback for a better user experience, handled as a deep link in your app. The callback carries verificationSessionId and status as query parameters.
Why does the WebView show a white screen?
Check that the session URL is valid and has not expired, that the device has an internet connection and that JavaScript is enabled in the WebView settings. On Android, also enable DOM storage, which Didit lists as required for session storage.
How does my backend get the full verification result?
Through a webhook. The callback only tells your app the session ID and a status, while your backend receives the complete, signed decision in a status.updated webhook. Verify its HMAC-SHA256 (hash-based message authentication code) signature before you update the user.

Compliance built in

Audited, certified and attested.

We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center

  • Regulation encoded into your flows

    Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.

  • Ready for AMLR

    Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.

  • Trusted by EU regulators

    After a year of supervised testing, EU financial regulators confirmed that verifying with Didit is safer than checking an ID in person.

  • Audited, not self-declared

    iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • SOC 2 Type 2
  • ISO 27001
  • iBeta Level 1 and Level 2
  • EU regulator attestation
  • FSM youth protection
  • GDPR
  • EBA remote onboarding
  • MiCA compatible
  • FIDO Alliance member
  • AMLREU AML Regulation ready

Integration · Didit MCP

Run Didit from your own AI agent

Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
  • Run investigationsAsk why a session was declined, review cases, search people and companies.
  • Change rulesCreate payment rules, test them on past data and switch them on.
  • Pull reportsAsk for numbers, exports or the audit log.

Start

Start with the native SDK

Create an account and get your sandbox key. Use a WebView only if no native SDK fits.

Free sandbox. Credit applies to work-email sign-ups.