Add the dependency:
npm i @paraboly/react-native-barcode-scanner
"react": ">= 16.x.x",
"react-native": ">= 0.55.x",
"react-native-camera": ">= 3.31.0"
Do not forget to add this on Podfile
pod 'react-native-camera', path: '../node_modules/react-native-camera', subspecs: [
'TextDetector',
'FaceDetectorMLKit',
'BarcodeDetectorMLKit'
]
In app -> build.gradle -> defaultConfig add this line
missingDimensionStrategy 'react-native-camera', 'general'
import BarcodeScanner from "@paraboly/react-native-barcode-scanner";
I suggest you that you the barcode scanner as a new Screen and make it a part of Navigation Service.
<BarcodeScanner />
FreakyCoder, [email protected]
React Native Barcode Scanner is available under the MIT license. See the LICENSE file for more info.