@angelcat/react-native-honeywell-barcode-scanner
v0.0.8
Published
React Native Honeywell Barcode Scanner
Downloads
84
Readme
React Native Honeywell Barcode Scanner
A React Native library for integrating Honeywell barcode scanners into your React Native applications. This library provides a simple and efficient way to interact with Honeywell barcode scanning devices on Android platform.
Features
- Support for Honeywell barcode scanning devices
- Simple and intuitive API
- TypeScript support
- Compatible with React Native 0.79.2 and above
Requirements
- Android device with Honeywell barcode scanner hardware
- Does not work on Android emulators
- Does not work on iOS devices
Installation
npm install @angelcat/react-native-honeywell-barcode-scanner
# or
yarn add @angelcat/react-native-honeywell-barcode-scannerUsage
import Scanner from '@angelcat/react-native-honeywell-barcode-scanner';
// Initialize the scanner
Scanner.initializeScanner()
.then(() => {
console.log('Scanner initialized successfully');
})
.catch((error) => {
console.error('Failed to initialize scanner:', error);
});
// Setup barcode read listener
const unsub = Scanner.onBarcodeRead((e) => {
console.log('Scanned barcode:', e.data);
});
// Setup error listener
const errorUnsub = Scanner.onBarcodeError((e) => {
console.error('Scanning error:', e.error);
});
// Start scanning
Scanner.startScan();
// Stop scanning when done
Scanner.stopScan();
// Clean up listeners
unsub();
errorUnsub();API Reference
Methods
initializeScanner(): Initialize the barcode scannerstartScan(): Start the barcode scannerstopScan(): Stop the barcode scanneronBarcodeRead(callback): Set up listener for barcode scanscallback(event): Called when a barcode is scannedevent.data: The scanned barcode data
onBarcodeError(callback): Set up listener for scanner errorscallback(event): Called when an error occursevent.error: The error message
Contributing
We welcome contributions! Please see our contributing guide for more details.
License
MIT © KyoNguyen
Made with create-react-native-library
