UNPKG

1.81 kBMarkdownView Raw
1# expo-barcode-scanner
2
3Allows scanning variety of supported barcodes both as standalone module and as extension for expo-camera. It also allows scanning barcodes from existing images.
4
5# API documentation
6
7- [Documentation for the master branch](https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/sdk/bar-code-scanner.md)
8- [Documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/bar-code-scanner/)
9
10# Installation in managed Expo projects
11
12For managed [managed](https://docs.expo.io/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/bar-code-scanner/).
13
14# Installation in bare React Native projects
15
16For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.
17
18### Add the package to your npm dependencies
19
20```
21expo install expo-barcode-scanner
22```
23
24### Configure for iOS
25
26Add `NSCameraUsageDescription` and `NSMicrophoneUsageDescription` key to your `Info.plist`:
27
28```xml
29<key>NSCameraUsageDescription</key>
30<string>Allow $(PRODUCT_NAME) to use the camera</string>
31<key>NSMicrophoneUsageDescription</key>
32<string>Allow $(PRODUCT_NAME) to use the microphone</string>
33```
34
35Run `npx pod-install` after installing the npm package.
36
37### Configure for Android
38
39This package automatically adds the `CAMERA` permission to your app.
40
41```xml
42<!-- Added permissions -->
43<uses-permission android:name="android.permission.CAMERA" />
44```
45
46# Contributing
47
48Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing).