A React Native module for integrating with Zebra DataWedge on Android devices.
npm install react-native-kega-datawedge
# or
yarn add react-native-kega-datawedgeimport { BarcodeModule } from 'react-native-kega-datawedge';
// Start scanning with default decoders
BarcodeModule.read({
type: ["QR", "Code 128", "Code 39", "EAN-13", "UPC-A", "PDF417"]
});
// Listen for scan results
BarcodeModule.addEventListener('onBarcode', (scanData) => {
console.log('Scanned:', scanData.data);
console.log('Type:', scanData.labelTypeName);
});You can pass additional DataWedge parameters using the params array. Each parameter should be an object with key and value properties:
BarcodeModule.read({
type: ["QR", "Code 128"],
params: [
{ key: "picklist_enabled", value: "true" },
{ key: "decode_led_feedback", value: "false" },
{ key: "decode_audio_feedback_uri", value: "system_default_notification" },
{ key: "decode_haptic_feedback", value: "true" },
{ key: "illumination_mode", value: "off" }
]
});An array of barcode types to enable. See Supported Barcode Types for a complete list.
Common types include:
"QR""Code 128""Code 39""EAN-13""UPC-A""PDF417"- And many more...
An array of additional DataWedge configuration parameters. Each object in the array should have:
key(string): The DataWedge parameter namevalue(string): The parameter value
Common parameters include:
picklist_enabled: Enable/disable picklist modedecode_led_feedback: Control LED feedback on successful decodedecode_audio_feedback_uri: Set custom audio feedbackillumination_mode: Control camera illuminationviewfinder_mode: Set viewfinder behavior
Starts barcode scanning with the specified configuration.
Stops barcode scanning.
Fired when a barcode is successfully scanned.
Event data:
data: The scanned barcode datatype: The raw barcode type codelabelTypeName: Human-readable barcode type name
Fired when DataWedge broadcasts are received (for debugging purposes).
- Android device with Zebra DataWedge installed
- React Native 0.60+