Skip to main content
This guide covers how to embed the Didit web verification flow inside a native mobile WebView component. It is not the same as the native iOS/Android/React Native/Flutter SDKs — it is a fallback for platforms that cannot use a native SDK.

Always prefer native SDKs

Native SDKs are available for iOS, Android, React Native, and Flutter. They provide significantly better performance, camera handling, NFC passport/ID reading, biometric integration, and user experience. Use WebView only if no native SDK is available for your platform.

iOS SDK

Native Swift SDK for iOS 13+

Android SDK

Native Kotlin SDK for Android 6.0+

React Native SDK

Cross-platform TypeScript API. Expo compatible.

Flutter SDK

Cross-platform Dart API. pub.dev package.

When to Use WebView

Use WebView integration only when:
  • You’re building on a platform without a native SDK (e.g., Xamarin, Cordova, or other niche frameworks)
  • You need a quick prototype or proof of concept before integrating the native SDK
  • You’re migrating from web and want a temporary bridge to a native integration

How It Works

1

Create a session

Your backend calls the Create Session API and receives a hosted url.
2

Open in WebView

Your app loads the url in a WebView component.
3

User completes verification

The user goes through the verification flow inside the WebView.
4

Intercept callback

When done, the WebView navigates to your callback URL. Your app intercepts this navigation and extracts the result.
5

Get full results via webhook

Your backend receives the complete decision data via webhook.

Creating a Session

Before opening the verification flow, create a session from your backend:
Response (201 — the url embeds the 12-character session_token, not the session_id):
Load the url field in the WebView — never build it from session_token by hand.

React Native

Install the WebView package:

Implementation

React Native Demo

Expo + WebView verification example

Flutter

Add the required packages to pubspec.yaml:

Implementation

Flutter Demo

Flutter WebView verification example

Critical Configuration

User Agent (Required)

You must set a generic mobile user agent for the WebView to work correctly:
This ensures proper camera access, correct UI rendering, and optimal media playback.

Media Settings (Required)


Handling the Callback

After verification, the WebView redirects to your callback URL with query parameters:
For a better user experience, use a custom URL scheme (e.g., myapp://verification-complete) as your callback and handle it as a deep link in your app.

Troubleshooting

  1. Ensure mediaPlaybackRequiresUserGesture is false
  2. Verify camera permissions are granted at the OS level
  3. Check that the user agent string is set correctly
  1. Verify the session URL is valid and not expired
  2. Check internet connectivity
  3. Ensure JavaScript is enabled in the WebView settings
  1. Verify your callback URL matches what you set when creating the session
  2. Check that the navigation delegate/listener is properly configured
  3. Try setting callback_method to "both" when creating the session