Documentation
Camera & Microphone
Use getUserMedia in the WebView
Camera and microphone access use the standard browser API — no bridge message is required. The WebView forwards getUserMedia to the OS permission system when your app is built with the right flags.
const stream = await navigator.mediaDevices.getUserMedia({
audio: true,
video: true
});Build-time configuration
In the dashboard Permissions tab, enable Android and/or iOS for each capability your site uses. For iOS, customize the usage description with a specific example for App Store review.
- Android:
permissions.android.camera.enabled(and similar) add manifest entries when enabled. - iOS:
permissions.ios.camera.enabledinjectsNSCameraUsageDescriptionwith your text; WebView grantsgetUserMediaonly when enabled.
After changing permissions, publish and request a new build for the change to take effect.
Error handling
try {
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
} catch (err) {
if (err.name === 'NotAllowedError') {
// Permission denied or not enabled in app build
}
}