Skip to main content

Using WebView in Mobile Applications

This following section of the documentation provides additional insights on initializing of the WebSDK within a mobile app using WebView. We cover essential steps for configuring WebView to access device local storage, camera, and enable HTML5 video playback. We also address security policies and permissions necessary for proper operation.

What is WebView?

WebView(opens in new tab) is a component that allows developers to embed web content (HTML, CSS, JavaScript) within a mobile application. It acts as a mini-browser that runs inside the app, allowing you to display webpages, execute web applications, or even integrate third-party services such as WebSDKs directly into your mobile app’s user interface.

WebView is particularly useful for apps that need to display dynamic web content without opening a separate browser, giving users a seamless experience within the app itself.

Verification Method Limitations

Due to security constraints, some verification methods cannot be run within a WebView environment. If you intend to use WebView and want to ensure that all the verification methods you require are supported in this setup, please contact us at customer-support@authologic.com before starting your integration.

WebView Configuration

You need to ensure the following access in your application:

Local Storage

Ensure that the WebView has permission to access the device’s local storage. This is necessary for storing session data and caching purposes.

Camera

WebView should be capable of initializing the device’s camera for WebSDK’s liveness detection features.

When experiencing issues with camera access for liveness check make sure that the Permissions-Policy header doesn't restrict access to a camera and microphone and if allow is set check for "camera; microphone" values.
When experiencing issues with camera access for liveness check make sure that the Feature-Policy header for your webpage/frame or any other container with SDK doesn't have any restrictions for initializing camera like value 'none'.
For older iOS versions camera can be accessed only from Safari browser or WebView with SFSafariViewController.

HTML5 Video Playback

The WebSDK utilizes <video> tags for displaying video instructions. Therefore, HTML5 video playback must be enabled within the WebView.

If video-instructions are not played, try using WebChromeClient to enable video playback.

Autoplay and Inline Media Playback

Autoplay for videos in fullscreen mode should be disabled to avoid any unwanted interruptions or automatic playback of content that requires user interaction.

To support inline playback of video content without transitioning to fullscreen mode set the allowsInlineMediaPlayback to true in the WebView configuration when running the SDK.

Selector File for File Uploads

The selector file implementation is handled on your side. This is a required component for enabling file uploads within the WebView.

Make sure that the selector file is properly implemented in the app and is compatible with the WebSDK. This selector file helps users upload files or interact with file input elements when the SDK requires such interactions (e.g., during identity verification processes).

Summarizing

To summarize, make sure the following requirements are met by your application:

  • WebView is able to access device local storage.
  • WebView is able to initialize the camera.
  • HTML5 playback is allowed.
  • Autoplay in fullscreen mode is disabled.
Despite our sincere intentions, it is difficult to create perfect technical documentation. If you have an idea on how to improve this documentation, or you have trouble understanding any section, please email us at tech-support@authologic.com
Was this page helpful?
Powered by Authologic Nisaba