Vai al contenuto

Android Behavior

Questo contenuto non è ancora disponibile nella tua lingua.

The plugin listens for scan results through Android broadcasts. Your Zebra DataWedge profile must:

  • be associated with your app package
  • enable Intent Output
  • use Broadcast Intent delivery
  • send scans to the same action you pass into softScanTrigger()

If those values do not match, the plugin can still manage profiles and query DataWedge state, but scan events will not reach your Capacitor app.

Subscribe to the Capacitor scan listener to receive decoded data:

import { ZebraDataWedge } from '@capgo/capacitor-zebra-datawedge';
await ZebraDataWedge.addListener('scan', (event) => {
console.log(event.data);
console.log(event.labelType);
console.log(event.source);
});

softScanTrigger(intentAction) waits for the next scan broadcast on the action you provide and resolves with that decoded payload.

Use ZebraNotification.registerForNotification() when you need native scanner status or profile switch updates:

import {
DataWedgeNotificationType,
ZebraNotification,
} from '@capgo/capacitor-zebra-datawedge';
await ZebraNotification.registerForNotification({
notificationType: DataWedgeNotificationType.SCANNER_STATUS,
callback: (event) => {
console.log(event.scannerStatus);
},
});
  • DataWedge commands require Zebra’s com.symbol.datawedge package to be present and enabled.
  • softRfidTrigger() uses the first registered scan intent action. Register one before relying on RFID reads.
  • Keep one canonical intent action per scanning flow. That reduces mismatches between the DataWedge profile and your app listeners.