Camera, Microphone and Photos
Let your website take photos, upload images, record audio and run video calls inside your Android and iOS app, with the right permissions turned on.
Overview
Your website's normal camera and upload features work inside the app once the matching permissions are on. There is no special camera method to call: the app connects standard web features to the phone's camera, microphone and photo library.
Which permissions you need
| Your website feature | Turn on |
|---|---|
| Photo upload with a file input | Camera (to take a new photo) and/or Photo Library (to pick an existing one) |
| Video recording with sound | Camera and Microphone |
| Voice notes, audio recording | Microphone |
Live video or calls with getUserMedia / WebRTC | WebRTC Camera and WebRTC Microphone, plus Camera and Microphone |
| QR and barcode scanning | The Barcode Scanner plugin |
All are in Permissions › Device. Review the iOS purpose strings, save and start a new build.
Examples
Take or choose a photo with a standard file input:
<!-- Opens the camera directly -->
<input type="file" accept="image/*" capture="environment">
<!-- Lets the user choose camera or photo library -->
<input type="file" accept="image/*">Live camera video:
const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: false });
document.querySelector('video').srcObject = stream;Ask first, at the right moment, with the bridge:
const result = await wapp.permissions.request('camera');
if (result.success && result.status === 'granted') {
openCameraUpload();
}Purpose strings
On iOS, each of these permissions shows your purpose string in the system prompt. Make it specific, for example "Take a photo of your receipt to attach it to your return request."
Troubleshooting
- The file input only offers files, not the camera: check that Camera is on and that the installed app was built after you turned it on.
- The call shows a black video: turn on WebRTC Camera (and WebRTC Microphone) in addition to Camera and Microphone, then build again.
- The user denied access: use the denied message and the settings button in Permission prompts.