Camera and Permissions
The Digital ID WebView SDK supports the liveness camera on iOS and Android.
The widget uses the standard navigator.mediaDevices.getUserMedia() API.
There is no custom camera-request bridge.
The SDK observes the web request, applies its policy, and controls the native permission request. The widget uses the camera in step 2 of the user journey.
Web contract
Request video only:
Code
Apply these requirements:
- Request
{ video: true }. - Do not request audio with the video.
- Handle a rejected promise and provide retry or fallback content.
- Load the widget and redirect origins over HTTPS.
- Request the camera only when the liveness step starts.
- Do not use a popup or new window for camera capture.
| Constraints | Native capture type | SDK result |
|---|---|---|
{ video: true } | Camera | Permitted when the origin and OS permission are valid. |
{ video: true, audio: true } | Camera and microphone | Denied. The complete request fails. |
{ audio: true } | Microphone | Denied. |
| Display capture | Display | Denied. |
The SDK returns camera_unsupported or camera_missing_permission before it
accesses the camera. User denial and hardware failures use standard
DOMException values.
iOS requirements
On iOS, getUserMedia uses
WKUIDelegate.requestMediaCapturePermissionFor. The SDK permits only the
.camera capture type when the origin and frame meet the HTTPS policy.
- In-WebView capture requires iOS 14.3 or later.
- The host application must define
NSCameraUsageDescription. - The native permission alert appears on first use.
If the application does not define the usage description, the SDK returns
camera_missing_permission.
Code
Android requirements
On Android, getUserMedia calls
WebChromeClient.onPermissionRequest for RESOURCE_VIDEO_CAPTURE. The SDK
permits video and denies audio or other resources.
- The SDK manages the runtime
CAMERApermission on API 23 and later. - The application manifest must define
android.permission.CAMERA. - Use a WebRTC-capable System WebView over HTTPS.
- Set an approximate minimum SDK level of API 24 or later.
- A permanent permission denial provides a link to the application settings.
If the manifest does not define the permission, the SDK returns
camera_missing_permission. If the System WebView does not support the
required capture, the SDK returns camera_unsupported.
Code
Do not send a request to a native camera bridge. Do not add audio to the liveness request. Do not use a non-HTTPS page, popup, or new window.
