Camera features — scanning, document capture, AR, real-time analysis — demand a fast, low-level camera API. react-native-vision-camera is the modern choice: it gives direct access to device cameras with high frame rates and a frame-processor system for real-time processing.

Key takeaways

  • Request camera (and microphone, for video) permissions before mounting the camera view.
  • Select a device and format that match your use case to balance quality and performance.
  • Use frame processors for real-time tasks like scanning without round-tripping every frame to JS.

Permissions and device selection

Camera access requires runtime permission on both platforms and a usage-description string on iOS. After permission is granted, you select a camera device (back, front, or a specific lens) and a format describing resolution and frame rate, then render the camera view bound to that device.

Choosing a sensible format matters: a 4K 60fps stream is wasteful for a barcode scanner and will heat the device, while a lower resolution keeps things fast and battery-friendly.

Capturing photos and video

The camera reference exposes methods to take a photo or record video, returning file paths you can upload or display. For most apps the capture API is all you need, with options for flash, stabilization, and quality.

Frame processors for real-time work

Vision Camera's standout feature is frame processors — JavaScript worklets that run on each camera frame to do real-time work like QR/barcode scanning, face detection, or ML inference, without the cost of shuttling full frames across the bridge. This is what makes scanning and AR-style features feel instant.