rawScanData
Event triggered when a barcode is successfully scanned.
Event Data
{
scanType: string, // Human-readable scan type
scanText: string // Scanned data
}
Example
window.addEventListener('rawScanData', (event) => {
console.log('Scan Type:', event.scanType);
console.log('Data:', event.scanText);
// Handle different scan types
if (event.scanType === 'MRZ') {
const mrzData = JSON.parse(event.scanText);
console.log('Passport Number:', mrzData.documentNumber);
} else if (event.scanType === 'QR') {
console.log('QR Code:', event.scanText);
}
// Reset for next scan in multi-scan mode
AilaCordovaPlugin.resetScan();
});