react-native-barcode-scanner-universal
Just combine react-native-barcodescanner
and react-native-camera
, because react-native-barcodescanner
provides Android version, react-native-camera
provides iOS version.
Install
Install library
npm install --save react-native-barcode-scanner-universal
----------- IMPORTANT ------------
Link native libraries of react-native-barcodescanner
and react-native-camera
which rnpm || npm install -g rnpm
rnpm link react-native-camera
rnpm link react-native-barcodescanner
Also can link manually
See:
- https://github.com/lwansbrough/react-native-camera#manual-install
- https://github.com/ideacreation/react-native-barcodescanner#installation
Usage
{ let scanArea = null if PlatformOS === 'ios' scanArea = <View style=stylesrectangleContainer> <View style=stylesrectangle /> </View> return <BarcodeScanner onBarCodeRead= console style=stylescamera> scanArea </BarcodeScanner> } const styles = StyleSheet
License
MIT.