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

Package detail

react-native-camera

react-native-community342.2kMIT AND Apache-2.0 AND BSD-3-Clause4.2.1TypeScript support: included

A Camera component for React Native. Also reads barcodes.

barcode, camera, code, native, qr, react, react-native

readme

React Native Camera Backers on Open Collective Sponsors on Open Collective npm version npm downloads

🚧🚧 Looking for maintainers and backers 🚧🚧

See this issue

We are looking for maintainers for this package, or to depreciate this in favor of react-native-vision-camera or expo-camera, if nobody want to maintain this package.

Docs

Follow our docs here https://react-native-camera.github.io/react-native-camera/

Sponsors

If you use this library on your commercial/personal projects, you can help us by funding the work on specific issues that you choose by using IssueHunt.io!

This gives you the power to prioritize our work and support the project contributors. Moreover it'll guarantee the project will be updated and maintained in the long run.

issuehunt-image

react-native-camera for enterprise

Available as part of the Tidelift Subscription

The maintainers of react-native-camera and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

Open Collective

You can also fund this project using open collective

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]

Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor]

The comprehensive camera module for React Native.

Supports:

  • photographs.
  • videos
  • face detection (Android & iOS only)
  • barcode scanning
  • text recognition (optional installation for iOS using CocoaPods)

Example import

import { RNCamera, FaceDetector } from 'react-native-camera';

How to use master branch?

We recommend using the releases from npm, however if you need some features that are not published on npm yet you can install react-native-camera from git.

yarn: yarn add react-native-camera@git+https://git@github.com/react-native-community/react-native-camera.git

npm: npm install --save react-native-camera@git+https://git@github.com/react-native-community/react-native-camera.git

Contributing

  • Pull Requests are welcome, if you open a pull request we will do our best to get to it in a timely manner
  • Pull Request Reviews are even more welcome! we need help testing, reviewing, and updating open PRs
  • If you are interested in contributing more actively, please contact me (same username on Twitter, Facebook, etc.) Thanks!
  • We are now on Open Collective! Contributions are appreciated and will be used to fund core contributors. more details
  • If you want to help us coding, join Expo slack https://slack.expo.io/, so we can chat over there. (#react-native-camera)
Permissions

To use the camera,

1) On Android you must ask for camera permission:

  <uses-permission android:name="android.permission.CAMERA" />

To enable video recording feature you have to add the following code to the AndroidManifest.xml:

  <uses-permission android:name="android.permission.RECORD_AUDIO"/>
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

5j2jduk

2) On iOS, you must update Info.plist with a usage description for camera

...
<key>NSCameraUsageDescription</key>
<string>Your own description of the purpose</string>
...

For more information on installation, please refer to installation requirements.

For general introduction, please take a look into this RNCamera.

Security contact information

To report a security vulnerability, please use the

Tidelift security contact.

Tidelift will coordinate the fix and disclosure.

changelog

THE CHANGELOG OF FURTHER VERSIONS (STARTING WITH 1.4.0) IS MAINTAINED WITH GITHUB RELEASES AND CAN BE FOUND HERE

1.3.1-9 (2018-10-24)

Chores
Documentation Changes
Bug Fixes
Reverts
  • check if face or text detector libraries are included independently (#1882) (9efd7554)

1.3.0-8 (2018-09-26)

Build System / Dependencies
Chores
  • ts: add doNotSave to ts type definitions (f0c18b7c)
  • update: update package.json packages (#1739) (843cbf4f)
New Features
  • adds autoFocusPointOfInterest to iOS (39cc29de)
Bug Fixes
  • rn-camera:
  • added some missing typescript declarations (#1792) (a5c67376)
  • android base64 string format for consistency with ios (#1776) (d4b4ee11)
  • update docs and add check for focus mode support (ca5a12b4)

1.2.0-7 (2018-08-09)

Build System / Dependencies
Documentation Changes
  • expo: explain how to migrate to and from expo camera module (#1605) (4a9322cb)
New Features
Bug Fixes
  • rn-camera:
    • fix codec backwards compat (91f5bf45)
    • fix types, conversions and casts (83d0618e)
  • picture-size:
    • create None default value (ad87c8e3)
    • export method and change default value (9efb7f14)
Other Changes
  • Implement video stabilization mode property for ios (#1606) (a090faa0)

1.1.5-2 (2018-06-14)

Build System / Dependencies
Chores
  • cameraview:
    • integrate google's cameraview directly on rncamera? (d11ed319)
    • update camera view (501ffe83)
  • lint:
  • package: enforce no errors on lint and update packages (00f4f4c1)
  • gms: change default gms to 12.0.0 (94c8968b)
Documentation Changes
  • expo: explain how to migrate to and from expo camera module (#1605) (4a9322cb)
  • recipes: add some recipes (ef5c2fef)
New Features
Bug Fixes
  • rn-camera:
  • picture-size:
    • create None default value (ad87c8e3)
    • export method and change default value (9efb7f14)
  • cache: store video recordings in same directory as photos (bba84a98)
  • rn_camera: improve naming (3811d82c)
  • search-paths: remove unnecessary search paths and add missing one (dee298b4)
  • styles: place style sheet above everything,prevent undefined styles (01501892)
  • warnings: remove inline styles (716c4e38)
  • barcode: better name google variables and correct init (38e96ed2)
  • Android: image stretched instead of cropped (73eb5fd2)
  • barcode-prop: fix default value and add more values (2c87b44b)
  • docs:
    • move skipProcessing to 'Supported options' (8054200f)
    • Header on the wrong position (589a0819)
  • types: fix types for #1402 (26f9a1e5)
  • ios: add video output early to avoid underexposed beginning (9ef5b29a)
Other Changes
  • Implement video stabilization mode property for ios (#1606) (a090faa0)
  • Fix java.lang.ArrayIndexOutOfBoundsException with image rotation (6ce014d3)

1.1.4-6 (2018-05-21)

1.1.3-5 (2018-05-18)

New Features
Bug Fixes
  • rn-camera: inject correct status (858cc4c9)
  • cache: store video recordings in same directory as photos (bba84a98)
  • rn_camera: improve naming (3811d82c)
Other Changes
  • Fix java.lang.ArrayIndexOutOfBoundsException with image rotation (6ce014d3)

1.1.2-4 (2018-04-25)

Chores
  • cameraview: integrate google's cameraview directly on rncamera? (d11ed319)
Bug Fixes
  • search-paths: remove unnecessary search paths and add missing one (dee298b4)

1.1.1-3 (2018-04-15)

Build System / Dependencies
Chores
  • lint:
  • package: enforce no errors on lint and update packages (00f4f4c1)
New Features
  • ci: add first circleci lint and check script (ee385eec)
  • android: make android gradle check work (1c7f231a)
Bug Fixes
  • styles: place style sheet above everything,prevent undefined styles (01501892)
  • warnings: remove inline styles (716c4e38)

1.1.0-2 (2018-04-15)

Chores
  • gms: change default gms to 12.0.0 (94c8968b)
  • cameraview: update camera view (501ffe83)
Documentation Changes
New Features
Bug Fixes
  • barcode: better name google variables and correct init (38e96ed2)
  • Android: image stretched instead of cropped (73eb5fd2)
  • barcode-prop: fix default value and add more values (2c87b44b)
  • docs:
    • move skipProcessing to 'Supported options' (8054200f)
    • Header on the wrong position (589a0819)
  • types: fix types for #1402 (26f9a1e5)
  • ios: add video output early to avoid underexposed beginning (9ef5b29a)

1.0.3-1 (2018-03-24)

Chores
  • restored original CameraModule.java (7bea109e)
Documentation Changes
  • rncamera:
    • specifying onTextRecognized callback prototype (48611212)
    • docs for text recognition usage (68639b82)
  • codec: document ios codec option (2b9d8db2)
New Features
  • chore: try to automate changelog (cc5f6e62)
  • android:

    • integrating Google Vision's text recognition (fcaa9452)
  • Android:

  • types: update types for video recording codec (f9252254)
  • rn-camera: add codec option for ios (c0d5aabf)
Bug Fixes
  • typo: fix typo on package.json (706278d8)
  • textrecognition: height of text block (01e763b1)
  • issue #1246 - torch will be disabled when starting the record (8c696017)
  • ios-project: fix path to parent's ios project (4496c321)

1.0.2 (2018-03-10)

Chores
  • flow: add missing types to Picture options (6bff4d93)
  • types: add new keys to TakePictureOptions (cc272036)
  • face-detector: make face detection stoppage smoother (3b3c38dd)
New Features
  • types:
    • add FaceDetector declarations (ba218750)
    • add TypeScript definition files (a94bad5e)
Bug Fixes
  • types:
    • fix onBarCodeRead type (a9947b47)
    • fix definition for RNCameraProps.ratio (4d1616c5)
  • android-camera: revert to old camera api (8d9c06ad)

1.0.1 (2018-02-14)

New Features
  • release-script: add script to package json (b0503dc8)
  • changelog: add changelog script (d2263937)
  • mirror: add option to give "mirrorImage" flag to takePicture. (0b6f0abd)
Bug Fixes
  • focusWarning: fix focus depth warning being shown for ios. (79698b81)
  • imports: delete some useless imports which may cause problems (a5b9f7e7)

master

1.0.0

  • RNCamera as main camera implementation for both iOS and Android (base on expo module)
  • FaceDetector feature for both iOS and Android (based on expo module)
  • RCTCamera deprecated

0.13.0

  • added RNCamera implementation for android
  • added FaceDetector for android