Skip to main content

onScan

Triggered when a barcode is successfully scanned.

Event Data

{
scanTypeHumanReadable: string;
scanType: number;
scanText: string;
}

Example

const subscription = AilaSDK.onScan((event) => {
console.log('Barcode Type:', event.scanTypeHumanReadable);
console.log('Data:', event.scanText);

// Handle the scan
processScan(event.scanText);
});

// Cleanup
return () => {
// Stop scanning when done
AilaSDK.stopScanning();
};