0.1.20 • Published 4 months ago
react-native-barcode-scanner-fabric v0.1.20
react-native-barcode-scanner
qr code scanner for react native
Installation
npm install react-native-barcode-scanner
// config scan file module inside MainApplication.java
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new ScanQRFilePackage());
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}
Usage
import { BarcodeScannerView } from "react-native-barcode-scanner";
import { TouchableOpacity } from 'react-native';
import { scan } from 'react-native-barcode-scanner';
// supported formats: 'AZTEC' | 'CODABAR' | 'CODE_39'| 'CODE_93'| 'CODE_128' | 'DATA_MATRIX' | 'EAN_8' |'EAN_13' | 'ITF' | 'MAXICODE' |'PDF_417'| 'QR_CODE'| 'RSS_14' | 'RSS_EXPANDED' | 'UPC_A' | 'UPC_E' | 'UPC_EAN_EXTENSION'
// ...
<BarcodeScannerView
flashModeEnabled
autoFocusEnabled
frameBorderColor="#eb4034"
acceptFormats={
{
acceptedFormats : ['QR_CODE','PDF_417']
}
}
style={styles.box}
onScanResultListener={(scanEvent) => {
// result value
console.log(`Result: ${scanEvent.nativeEvent.value} `);
}}
<TouchableOpacity onPress= {async ()=>
{
const result = await scan("test")
console.log(`scanResult :${result}`)
}
}>
<Text>Scan Test Image</Text>
</TouchableOpacity>
/>
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
0.1.20
4 months ago
0.1.10
8 months ago
0.1.11
8 months ago
0.1.12
8 months ago
0.1.13
8 months ago
0.1.14
8 months ago
0.1.15
8 months ago
0.1.16
8 months ago
0.1.17
8 months ago
0.1.18
8 months ago
0.1.19
8 months ago
0.1.8
9 months ago
0.1.7
9 months ago
0.1.9
9 months ago
0.1.3
1 year ago
0.1.6
1 year ago
0.1.5
1 year ago
0.1.1
1 year ago