Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

expo-camera

expo881.4kMIT16.0.18TypeScript support: included

A React component that renders a preview for the device's either front or back camera. Camera's parameters like zoom, auto focus, white balance and flash mode are adjustable. With expo-camera, one can also take photos and record videos that are saved to t

react-native, expo, camera

readme

expo sdk

Expo

Expo SDK version Chat or ask a question License: MIT Downloads

Try Expo in the Browser  •  Read the Documentation  •  Learn more on our blog  •  Request a feature

Follow us on

Expo on X   Expo on GitHub   Expo on Reddit   Expo on LinkedIn   Expo on LinkedIn

Introduction

Expo is an open-source platform for making universal native apps that run on Android, iOS, and the web. It includes a universal runtime and libraries that let you build native apps by writing React and JavaScript.

This repository includes the Expo SDK, Modules API, Go app, CLI, Router, documentation, and various other supporting tools. Expo Application Services (EAS) is a platform of hosted services that are deeply integrated with Expo open source tools. EAS helps you build, ship, and iterate on your app as an individual or a team.

Read the Expo Community Guidelines before interacting in the repository. Thank you for helping keep the Expo community open and welcoming!

Table of contents

📚 Documentation

Learn about building and deploying universal apps in our official docs!

🗺 Project Layout

  • packages All the source code for Expo modules, if you want to edit a library or just see how it works this is where you'll find it.
  • apps This is where you can find Expo projects which are linked to the development modules. You'll do most of your testing in here.
  • apps/expo-go This is where you can find the source code for Expo Go.
  • apps/expo-go/ios/Exponent.xcworkspace is the Xcode workspace. When developing iOS, always open this instead of Exponent.xcodeproj because the workspace also loads the CocoaPods dependencies.
  • docs The source code for https://docs.expo.dev
  • templates The template projects you get when you run npx create-expo-app
  • react-native-lab This is our fork of react-native used to build Expo Go.
  • guides In-depth tutorials for advanced topics like contributing to the client.
  • tools contain build and configuration tools.
  • template-files contains templates for files that require private keys. They are populated using the keys in template-files/keys.json.
  • template-files/ios/dependencies.json specifies the CocoaPods dependencies of the app.

🏅 Badges

Let everyone know your app can be run instantly in the Expo Go app!

runs with Expo Go

runs with Expo Go

[![runs with Expo Go](https://img.shields.io/badge/Runs%20with%20Expo%20Go-000.svg?style=flat-square&logo=EXPO&labelColor=f3f3f3&logoColor=000)](https://expo.dev/client)

[![runs with Expo Go](https://img.shields.io/badge/Runs%20with%20Expo%20Go-4630EB.svg?style=flat-square&logo=EXPO&labelColor=f3f3f3&logoColor=000)](https://expo.dev/client)

👏 Contributing

If you like Expo and want to help make it better then check out our contributing guide! Check out the CLI package to work on the Expo CLI.

❓ FAQ

If you have questions about Expo and want answers, then check out our Frequently Asked Questions!

If you still have questions you can ask them on our Discord and Forums or X @expo.

💙 The Team

Curious about who makes Expo? Here are our team members!

License

The Expo source code is made available under the MIT license. Some of the dependencies are licensed differently, with the BSD license, for example.

Star the Expo repo on GitHub to support the project

changelog

Changelog

Unpublished

🛠 Breaking changes

🎉 New features

🐛 Bug fixes

💡 Others

16.0.18 — 2025-03-11

🐛 Bug fixes

16.0.17 — 2025-02-19

🐛 Bug fixes

16.0.16 — 2025-02-10

This version does not introduce any user-facing changes.

16.0.15 — 2025-02-06

This version does not introduce any user-facing changes.

16.0.14 — 2025-01-23

This version does not introduce any user-facing changes.

16.0.13 — 2025-01-20

🐛 Bug fixes

  • [Android] Fix activeRecording visibility in ExpoCameraView (#34290 by @limbo56)

16.0.12 — 2025-01-19

This version does not introduce any user-facing changes.

16.0.11 — 2025-01-10

🐛 Bug fixes

16.0.10 — 2024-12-16

💡 Others

  • On Android, parse the pictureSize prop safely to prevent invalid values causing exceptions. (#33566 by @alanjhughes)

16.0.9 — 2024-12-05

🐛 Bug fixes

16.0.7 — 2024-11-22

🐛 Bug fixes

  • [iOS] Fix an issue where devices supporting the hevc codec have jpeg set in the photoSettings. (#33186 by @alanjhughes)

16.0.6 — 2024-11-19

🎉 New features

  • Add videoBitrate prop to allow setting the bitrate used when recording a video. (#33087 by @alanjhughes)

💡 Others

16.0.5 — 2024-11-13

💡 Others

  • [Android] Drop legacy cameraview-aar dependency. (#32853 by @alanjhughes)
  • [iOS] Return the correct bounding box and corner points when scanning barcodes. (#32871 by @alanjhughes)

16.0.4 — 2024-11-13

🐛 Bug fixes

16.0.3 — 2024-10-28

🐛 Bug fixes

  • [iOS] Fix build issue with after switch to Swift concurrency. (#32379 by @Eingin)

16.0.2 — 2024-10-25

This version does not introduce any user-facing changes.

16.0.1 — 2024-10-24

This version does not introduce any user-facing changes.

16.0.0 — 2024-10-22

🛠 Breaking changes

🎉 New features

  • Add shutterSound key to CameraPictureOptions, allowing users to disable the camera shutter sound when invoking takePictureAsync. (#31038) by @yuna5566

🐛 Bug fixes

  • Add missing react and react-native peer dependencies for isolated modules. (#30462 by @byCedric)
  • Only import from expo/config-plugins to follow proper dependency chains. (#30499 by @byCedric)
  • Add missing react-native-web optional peer dependency for isolated modules. (#30689 by @byCedric)
  • Fixed issue regarding using the "back"-facing on mobile web browswer. (#30811 by @entiendoNull)
  • Fix takePictureAsync quality option when set to 0. (#31587 by @davidavz)
  • [iOS] Fix crash related to sublayers on 0.75 and above on the new architecture. (#32194 by @alanjhughes)
  • [iOS] Fix regression in running the cameras cleanup function. (#32333 by @alanjhughes)
  • [iOS] Use an Actor to ensure correct order of changes to the barcode scanners outputs. (#32353 by @alanjhughes)

💡 Others

  • Removed redundant usage of EventEmitter instance. (#28946 by @tsapeta)
  • Updated docs for the pictureSize prop. (#30195 by @alanjhughes)
  • [Android] Migrated cameraview AAR to autolinking and removed related config-plugin about adding the maven repository. (#30707 by @kudo)
  • Remove the dependency on the legacy types from the newer package on web. (#30952 by @alanjhughes)
  • Remove preferredVideoStabilizationMode until is is fully supported. (#31514 by @alanjhughes)
  • [iOS] Migrate to Swift concurrency. (#31900 by @alanjhughes)

⚠️ Notices

15.0.16 - 2024-09-13

This version does not introduce any user-facing changes.

15.0.15 - 2024-08-24

🎉 New features

  • On Android, add support for setting the aspect ratio of the camera. (#29822 by @alanjhughes)
  • Support mirroring the output of the front facing camera. (#30430 by @alanjhughes)
  • On Android, support mirroring video when using front facing camera. Control mirroring with a prop. Deprecate mirror option on takePictureAsync and recordAsync. (#30548 by @alanjhughes)
  • Support pausing and resuming the preview. (#30666 by @alanjhughes)
  • Add active prop to stop and start the camera session. Useful with navigation where the camera is can still be active on a previous screen. (#30802 by @alanjhughes)

🐛 Bug fixes

15.0.14 - 2024-07-16

This version does not introduce any user-facing changes.

15.0.13 - 2024-07-03

🐛 Bug fixes

15.0.12 - 2024-06-20

🐛 Bug fixes

  • Prevent shutter sound when device volume is muted. (#29638 by @frederikocmr)
  • On Android, correct image orientation when exif is set to true in takePictureAsync. (#29712 by @alanjhughes)

15.0.11 - 2024-06-13

🐛 Bug fixes

💡 Others

15.0.10 — 2024-05-29

🐛 Bug fixes

  • On iOS, set previewLayer on scanner to get correct dimensions. (#28931 by @alanjhughes)
  • On Android, correctly handle orientation when landscape pictures are rendered. (#28929 by @alanjhughes)

15.0.9 — 2024-05-16

🐛 Bug fixes

  • On iOS, prevent a crash when rendering the view on a simulator. (#28911 by @alanjhughes)
  • On iOS, fix incorrect orientation when taking pictures in landscape. (#28917 by @alanjhughes)

15.0.8 — 2024-05-13

🐛 Bug fixes

15.0.7 — 2024-05-13

💡 Others

15.0.6 — 2024-05-10

🐛 Bug fixes

15.0.5 — 2024-05-09

🐛 Bug fixes

15.0.4 — 2024-05-07

🎉 New features

15.0.3 — 2024-04-29

🎉 New features

15.0.2 — 2024-04-24

🐛 Bug fixes

  • On iOS, fixed regression where recording a video captures dark frames. Reduced frequency of camera initialization. (#28427 by @alanjhughes)

15.0.1 — 2024-04-23

This version does not introduce any user-facing changes.

15.0.0 — 2024-04-18

🎉 New features

  • Add ability to disable permissions in config plugin by passing false instead of permission messages. (#28107 by @EvanBacon)
  • Add pictureSize prop to CameraView component. (#27664 by @alanjhughes)
  • Allow user to remove NSMicrophoneUsageDescription and ignore the mute prop if they don't intend to use video. (#28156 by @alanjhughes)
  • Add animateShutter prop to provide feedback when a picture is taken. Also added shutter sound on android. (#28211 by @alanjhughes)

🐛 Bug fixes

  • Allow users using xcode 14 to still build when including camera. (#27873 by @alanjhughes)
  • Fix an issue where the permission functions were being imported from the wrong file. (#27988 by @alanjhughes)
  • Fix an issue on iOS where the barcode types did not match the typescript representation. Also enabled scanning upc_a codes on iOS. (#28233 by @alanjhughes)

💡 Others

14.1.1 - 2024-03-13

This version does not introduce any user-facing changes.

14.1.0 - 2024-03-13

🐛 Bug fixes

  • On Android, fix empty qualities being passed to QualitySelector (#27126 by @leonhh)
  • On web, prevent creating a webworker when rendering on the server (#27222 by @marklawlor)
  • On iOS, fix method call on an optional variable. (#27235 by @alanjhughes)
  • Fix scanned frame bounds when scanning a barcode. (#27207 by @tamagokun)
  • Fix incorrect prop name flash being passed to native. (#27394 by @alanjhughes)
  • Ensure mute prop is passed to native so it is correctly initialiased even when not provided from JS. (#27546 by @alanjhughes)
  • On iOS, fix camera orientation on initial render. (#27545 by @alanjhughes)
  • On iOS, fix an issue where the configuration can be interuppted when the dev menu is presented on intial launch. (#27572 by @alanjhughes)
  • On iOS, fix getAvailablePictureSizes in the legacy package. (#27642 by @alanjhughes)

14.0.6 - 2024-03-07

🐛 Bug fixes

  • On iOS, fix the orientation value in onResponsiveOrientationChanged when exif is set to true. (#27314 by @alanjhughes)

14.0.5 - 2024-02-16

🎉 New features

  • BarCodeAnalyzer now passes an additional raw field to its onComplete callback, corresponding to the barcode value as it was encoded in the barcode without parsing. Will always be undefined on iOS. (#25391 by @ajacquierbret)

🐛 Bug fixes

💡 Others

14.0.4 - 2024-02-06

This version does not introduce any user-facing changes.

14.0.3 - 2024-01-26

🐛 Bug fixes

  • On iOS, barcode types were not converted correctly causing the scanner to not start immediately. (#26704 by @alanjhughes)
  • On iOS, fix maxDuration timescale on videos. (#26882 by @alanjhughes)

14.0.2 - 2024-01-23

🐛 Bug fixes

14.0.1 - 2023-12-19

This version does not introduce any user-facing changes.

14.0.0 — 2023-12-12

🎉 New features

  • Methods stopRecording, pausePreview and resumePreview have been updated to return promises. (#25737 by @lukmccall)

💡 Others

  • [iOS] Replace legacy FileSystem interfaces usage with core FileSystemUtilities. (#25495 by @alanhughes)

13.9.0 — 2023-11-14

🛠 Breaking changes

🎉 New features

🐛 Bug fixes

💡 Others

13.8.0 — 2023-10-17

🛠 Breaking changes

  • Dropped support for Android SDK 21 and 22. (#24201 by @behenate)
  • Mark the ratio param of getAvailablePictureSizes as required because omitting it causes a crash on Android. On iOS, the param has no effect. (#24234 by @vonovak)

💡 Others

  • Ship untranspiled JSX to support custom handling of jsx and createElement. (#24889 by @EvanBacon)

13.7.0 — 2023-09-15

This version does not introduce any user-facing changes.

13.4.4 — 2023-09-11

🐛 Bug fixes

13.6.0 — 2023-09-04

🎉 New features

  • Added support for React Native 0.73. (#24018 by @kudo)

🐛 Bug fixes

13.5.1 — 2023-08-02

This version does not introduce any user-facing changes.

13.5.0 — 2023-07-28

🐛 Bug fixes

  • Fixed issue with checking camera/microphone permissions in Firefox. (#22855 by @loganrosen)

13.4.2 - 2023-07-04

🐛 Bug fixes

13.4.1 — 2023-06-28

🐛 Bug fixes

  • Resolved an issue on Android where recording a video, even with the mute: true option, would still result in an audio permission exception. Furthermore, the mute flag was incorrectly referred to as muteValue, causing it to be consistently ignored (#23145 by @hirbod)

13.4.0 — 2023-06-13

🐛 Bug fixes

13.3.0 — 2023-05-08

This version does not introduce any user-facing changes.

13.2.1 — 2023-02-09

This version does not introduce any user-facing changes.

13.2.0 — 2023-02-03

🐛 Bug fixes

  • Fix path where simulator saves photos (#20872 by @pettomartino)
  • Fixed Cannot set prop 'barCodeScannerSettings' on view 'class expo.modules.camera.ExpoCameraView' on Android. (#21033 by @lukmccall)

💡 Others

  • On Android bump compileSdkVersion and targetSdkVersion to 33. (#20721 by @lukmccall)

13.1.0 - 2022-11-23

🐛 Bug fixes

  • Fix import issue on case-sensitive file systems (#20141 by @hirbod)

💡 Others

  • Use correct type for videoStabilizationMode option. (#20130 by @simek)

13.0.0 — 2022-10-25

🐛 Bug fixes

13.0.0-beta.1 — 2022-10-06

🛠 Breaking changes

  • [plugin] Upgrade minimum runtime requirement to Node 14 (LTS). (#18204 by @EvanBacon)
  • Bumped iOS deployment target to 13.0 and deprecated support for iOS 12. (#18873 by @tsapeta)

🎉 New features

  • On iOS and Android, added new additionalExif parameter to takePictureAsync() method so that users can add extra information to the photos, such as GPS coordinates. (#18469 by @alexyangjie)
  • Native module for camera view is now written in Swift using the new API. (#18703 by @tsapeta)

🐛 Bug fixes

  • Fix error when calling takePictureAsync() on Android emulator. (#18704) by @keith-kurak)
  • Add cornerPoints to onBarCodeScanned on Android. (#19357 by @igoro00)
  • Fix error where takePictureAsync() saved the photo to a global cache directory that was inaccessible in Expo Go. (#19205 by @aleqsio)

💡 Others

  • Drop @expo/config-plugins dependency in favor of peer dependency on expo. (#18595 by @EvanBacon)
  • Refactored inline Android emulator checks to use enhanced checking in EmulatorUtilities.isRunningOnEmulator(). (#16177) by @kbrandwijk, @keith-kurak)

12.3.0 — 2022-07-07

🐛 Bug fixes

  • On Web prevent the QR worker to be immediately cleaned up after finishing it's job to allow reusing it later (e.g. do not re-download every script upon repetitive worker launch). (#15369 by @jer-sen and #17833 by @bbarthec)
  • Fix bug on Android that would only allow you to scan one bar code. (#17655 by @witheroux)

12.2.0 — 2022-04-18

🎉 New features

  • Update useWebQRScanner to allow scanning QR codes with inverted colors (light foreground and dark background). (#16106 by @rissois)

🐛 Bug fixes

  • Fix crash on Android when app is restored from background by check for null value of pendingFaceDetectorSettings. (#16543 by @giautm)

💡 Others

  • Updated @expo/config-plugins from 4.0.2 to 4.0.14 (#15621 by @EvanBacon)
  • Replace CapturedPicture type with CameraCapturedPicture in events callback to avoid duplicated types. (#15936 by @Simek)

⚠️ Notices

  • On Android bump compileSdkVersion to 31, targetSdkVersion to 31 and Java version to 11. (#16941 by @bbarthec)

12.1.2 - 2022-02-04

🐛 Bug fixes

  • Fix null pointer exception when barcode scanner or face detector are not installed. (#16167 by @tsapeta)

12.1.1 - 2022-02-01

🐛 Bug fixes

  • Fix Plugin with id 'maven' not found build error from Android Gradle 7. (#16080 by @kudo)

12.1.0 — 2021-12-03

🐛 Bug fixes

  • Fix Gradle error when running Gradle from outside of the project directory. (#15109 by @kudo)

💡 Others

12.0.1 — 2021-10-01

This version does not introduce any user-facing changes.

12.0.0 — 2021-09-28

🛠 Breaking changes

  • Deprecate getPermissionsAsync and requestPermissionsAsync methods, use specific permission requesters. (#13855 by @bycedric)
  • Dropped support for iOS 11.0 (#14383 by @cruzach)

🎉 New features

  • Add useCameraPermissions and useMicrophonePermissions hooks from modules factory. (#13855 by @bycedric)
  • [plugin] Add monorepo support to Android config plugin for Gradle import. (#14521 by @EvanBacon)

🐛 Bug fixes

  • Fix QR code scanner in expo web by updating @koale/useworker to ^4.0.2 (#14138 by @fguitton)
  • Update video codec validation to properly reject an invalid codec option. (#13341 by @ajsmth)
  • Add get/requestMicrophonePermissionsAsync() and get/requestCameraPermissionsAsync() methods to named exports. (#13621 by @ajsmth)
  • Fix regression in video quality option of recordAsync() (#13659 by @ajsmth)
  • Update permission validation to check for only camera permissions in initWithModuleRegistry() (#13690 by @ajsmth)
  • Fix building errors from use_frameworks! in Podfile. (#14523 by @kudo)

💡 Others

11.1.1 — 2021-06-16

This version does not introduce any user-facing changes.

11.1.0 — 2021-06-07

🎉 New features

  • On iOS added new codec parameter in recordAsync() method and new method getAvailableVideoCodecsAsync() that queries the device for available video codecs. (#12772 by @ajsmth)
  • Added new requestCameraPermissionsAsync(), requestMicrophonePermissionsAsync(), getCameraPermissionsAsync() and getMicrophonePermissionsAsync() methods which gives more fine-grained control over requested permissions. (#12860 by @ajsmth)

💡 Others

11.0.3 — 2021-05-03

🐛 Bug fixes

11.0.2 — 2021-04-13

This version does not introduce any user-facing changes.

11.0.1 — 2021-04-01

🐛 Bug fixes

11.0.0 — 2021-03-10

🛠 Breaking changes

  • Remove deprecated barCodeTypes prop in favor of barCodeScannerSettings.barCodeTypes. (#11904 by @EvanBacon)

🎉 New features

🐛 Bug fixes

  • Remove peerDependencies and unimodulePeerDependencies from Expo modules. (#11980 by @brentvatne)

10.0.0 — 2021-01-15

⚠️ Notices

🛠 Breaking changes

🎉 New features

🐛 Bug fixes

9.1.1 — 2020-12-14

This version does not introduce any user-facing changes.

9.1.0 — 2020-11-17

🎉 New features

  • Added support for video poster to show while the camera is loading on web. (#9930 by @liorJuice)

9.0.0 — 2020-08-18

🛠 Breaking changes

  • Fix bug where barCodeTypes needed to be defined on web. (#9630 by @EvanBacon)
  • Fix bug where camera would sometimes not start on web desktop. (#9630 by @EvanBacon)
  • Deleted CaptureOptions in favor of CameraPictureOptions (#9558 by @EvanBacon)
  • Added camera permissions declarations to AndroidManifest.xml on Android. (#9224 by @bycedric)

🎉 New features

  • Added support for QR scanning on web. (#4166 by @EvanBacon)
  • Remove fbjs dependency
  • Delete prop-types in favor of TypeScript. (#8680 by @EvanBacon)
  • [camera] Directly import createElement from react-native-web for RNW v12 support. (#8773 by @EvanBacon)

🐛 Bug fixes

  • Fix QR scanning on Android and iOS. (#9741 by @EvanBacon)
  • [web] Fix bug where swapping cameras caused screen to flicker (#9558 by @EvanBacon)
  • [web] Fix bug where swapping cameras doesn't persist camera settings (#9558 by @EvanBacon)

8.3.1 — 2020-05-29

This version does not introduce any user-facing changes.

8.3.0 — 2020-05-27

🛠 Breaking changes

  • The base64 output will no longer contain newline and special character (\n, \r) on Android. (#7841 by @jarvisluong)

🎉 New features

  • Added exports for TypeScript definitions: CameraType, ImageType, ImageParameters, ImageSize, CaptureOptions, CapturedPicture (#8457 by @jarvisluong)