How to add a camera to your Expo app, in short
You add a camera to an Expo app by installing expo-camera with npx expo install expo-camera, asking for camera permission with the useCameraPermissions hook, and rendering a CameraView component once the user says yes. CameraView shows a live preview from the front or back camera. To take a photo, keep a ref to it and call takePictureAsync. To scan QR codes, pass barcodeScannerSettings and an onBarcodeScanned callback. expo-camera is included in Expo Go, so you can try it on your phone right away.
The camera code itself is short. What costs people time is picking expo-camera when the image picker would have done the job, shipping a vague permission message, forgetting the camera only works on a real device, and losing photos because they were left in the cache. This guide walks through each one.
expo-camera vs expo-image-picker: which one you need
Both can get a photo from the camera into your app. They solve different problems.
expo-camera vs expo-image-picker
| expo-camera | expo-image-picker | |
|---|---|---|
| What the user sees | A live preview inside your own screen, with your own buttons and overlays | The system camera or photo library screen |
| Good for | Scanners, custom shutters, document or ID capture with a frame overlay, video inside your UI | Profile photos, attachments, "add a photo" buttons |
| Code you write | Preview layout, shutter, flip, flash, saving the file | One function call that returns the picked or captured image |
| QR and barcode scanning | Yes, built in | No |
| Pick from the photo library | No | Yes |
My recommendation: start with the image picker unless the camera is the feature. It is less code, the system screen already handles flash, focus and retakes, and users already know how it works. If your app needs a scanner or a capture screen with your own design, that is when expo-camera earns its place. The picker route is covered in [how to add an image picker to your Expo app](/blog/how-to-add-an-image-picker-to-your-expo-app).
Step 1: Install expo-camera and set the permission messages
- Run: npx expo install expo-camera. The Expo installer picks the version that matches your SDK.
- Add the config plugin to app.json under plugins: ["expo-camera", { "cameraPermission": "...", "microphonePermission": "...", "recordAudioAndroid": true }].
- Write a cameraPermission message that names the feature, such as "Scan the QR code on your ticket to check in". This becomes the iOS NSCameraUsageDescription.
- Only taking photos? Set recordAudioAndroid to false so Android does not add the RECORD_AUDIO permission, and you do not need a microphone message. Recording video with sound needs both.
- Not scanning barcodes? Expo's docs say setting barcodeScannerEnabled to false reduces app size.
Config plugin settings are baked into the native app, so they only apply after you rebuild your development build or production binary. In Expo Go you are testing with Expo Go's own permission text, not yours.
Step 2: Ask for permission at the right moment
useCameraPermissions returns the current permission and a function to request it: const [permission, requestPermission] = useCameraPermissions(). The pattern from Expo's own example has three states:
- permission is null: it is still loading, so render an empty view.
- permission.granted is false: show a short screen that says what the camera is for, with a button that calls requestPermission.
- permission.granted is true: render the CameraView.
Ask when the user opens the camera feature, not on app launch. iOS only shows the system prompt once, so if they say no, the button has to send them to Settings instead. The full flow, including the Settings fallback, is in [how to request permissions in your Expo app](/blog/how-to-request-permissions-in-your-expo-app). For video with sound, request microphone access too with useMicrophonePermissions.
Step 3: Render the preview and take a photo
- Import it: import { CameraView, useCameraPermissions } from 'expo-camera'.
- Render <CameraView style={{ flex: 1 }} facing={facing} ref={cameraRef} onCameraReady={() => setReady(true)} />. Like any view, it needs a size or it renders nothing.
- Put your shutter and flip buttons in an absolutely positioned view on top of the preview.
- Flip cameras by switching the facing prop between 'back' and 'front'.
- On the shutter tap, call const photo = await cameraRef.current?.takePictureAsync({ quality: 0.7 }). Expo's docs say to wait for onCameraReady before calling it, so keep the shutter disabled until then.
takePictureAsync resolves to an object with a uri, width and height. Other useful props: flash ('off', 'on' or 'auto'), enableTorch for a steady light, zoom (0 to 1, as a share of the device's maximum zoom), and mirror for the front camera. quality runs from 0 to 1 and defaults to 1, which makes large files. If you are uploading the photo, a lower value saves your users' data and your storage bill.
Step 4: Record video
- Set mode="video" on CameraView. The default is 'picture'.
- Start with const video = await cameraRef.current?.recordAsync({ maxDuration: 60 }). The promise resolves with the file uri when recording stops.
- Stop with cameraRef.current?.stopRecording(). Recording also stops if maxDuration or maxFileSize is reached or the preview stops.
- Flipping the camera during a recording stops it, according to Expo's docs, so disable the flip button while recording.
- Use the mute prop for silent video if you do not want to ask for the microphone at all.
Like photos, videos are saved to the cache directory, so move or upload them before you rely on them. Set maxDuration on purpose: a forgotten recording can fill a phone faster than you think.
Step 5: Scan QR codes and barcodes
expo-camera can scan codes in the live preview. Pass barcodeScannerSettings={{ barcodeTypes: ['qr'] }} and an onBarcodeScanned callback, and you get the code's type and its data (for a QR code, often a URL). Only list the types you actually expect, which keeps false matches down.
In practice the callback keeps getting called while the code stays in frame, so guard it: set a flag or a ref on the first scan, act on it once, and pass onBarcodeScanned={scanned ? undefined : handleScan} until the user is ready to scan again.
The mistakes that break camera screens
- Testing on a simulator. Expo's docs mark the camera as device only on iOS and Android, so test on a real phone.
- Leaving the camera mounted on another screen. Expo's docs say only one camera preview can be active at a time and to unmount the camera when its screen is not focused. With tabs or a stack, render CameraView only while that screen has focus.
- Calling takePictureAsync before onCameraReady, or while the preview is paused. On Android that throws.
- Treating the returned URI as permanent. It lives in the cache.
- Asking for the microphone in a photo-only app. Every permission you request is one more thing to explain to the user and to App Review.
What App Review checks
- A specific purpose string for the camera, and for the microphone if you record sound.
- The camera is requested when the user reaches the feature, and the rest of the app still works if they say no.
- If photos or videos leave the device, your [App Privacy details](/blog/app-privacy-details-app-store-connect) say what you collect and why.
- The reviewer can reach the camera feature. If it sits behind sign-in, give them a demo account in the review notes. [How to pass Apple app review](/blog/how-to-pass-apple-app-review) covers the review notes.
Have Claude Code build it for you
Open your project in the Claude Code desktop app and describe the screen you want, not just "add a camera". A prompt that works:
Add a line to your [CLAUDE.md](/blog/claude-md-for-expo-apps) like "camera screens use expo-camera's CameraView; the picker is expo-image-picker; never request microphone permission unless we record video" so later sessions stay consistent. Then test it yourself on a real phone, in a [development build](/blog/expo-go-vs-development-build), because that is the only place your own permission text shows up.
The short version
To add a camera to your Expo app: install expo-camera, set a specific cameraPermission message in its config plugin, gate the screen with useCameraPermissions, and render a sized CameraView with a ref. Take photos with takePictureAsync after onCameraReady, record with recordAsync in video mode, and scan codes with onBarcodeScanned. Copy anything you keep out of the cache, test on a real device, and use the image picker instead if you do not need your own camera UI.
If you are building your first iOS app with Claude Code and Expo and want a second pair of eyes on it before App Review, bring it to App Store Launch Club. Members share their builds for feedback, and the [curriculum](/curriculum) covers the full path from first build to first users. Join at applaunchclub.co for $9 a month.
Short, practical drops on app ideas, validating fast, store listings, and passing app review. No spam, unsubscribe anytime.
Frequently asked questions
Does expo-camera work in Expo Go?
Yes. Expo's docs list expo-camera as included in Expo Go. Your own permission messages from the config plugin only apply in a development or production build, so do a final check there.
Why is my camera preview black?
Usually one of three things: you are on a simulator (the camera is device only), permission has not been granted yet, or the CameraView has no size. Another screen still holding a mounted camera can also cause it, since only one preview can be active at a time.
Should I use expo-camera or expo-image-picker?
Use expo-image-picker when the system camera screen is fine and you just need a photo. Use expo-camera when the camera is part of your own screen, like a QR scanner, a custom shutter, or a capture frame overlay.
Where are photos from takePictureAsync saved?
In your app's cache directory. Expo's docs say the local URI is temporary, so copy the file into permanent storage with expo-file-system or upload it. Saving to the user's photo library needs expo-media-library.
How do I scan a QR code in Expo?
Pass barcodeScannerSettings={{ barcodeTypes: ['qr'] }} and an onBarcodeScanned callback to CameraView. The result includes the code's type and data. Guard the callback so you only act on the first scan.
Do I need microphone permission for the camera?
Only if you record video with sound. For photo-only apps, set recordAudioAndroid to false in the config plugin and do not request the microphone. You can also record silent video with the mute prop.
Can I use the old Camera component from expo-camera?
Current SDKs use CameraView and the useCameraPermissions hook. If you are following an older tutorial that imports Camera, check the expo-camera page for your SDK version, since the API changed.
Last reviewed by David on October 13, 2026

