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
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.
HTML5 Video Playback
The WebSDK utilizes <video> tags for displaying video instructions. Therefore, HTML5 video playback must be
enabled within the WebView.
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.