Getting Started
Salin prompt pengaturan dengan langkah instalasi dan panduan markdown lengkap untuk plugin ini.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-zebra-datawedge`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/zebra-datawedge/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
-
Pasang plugin
Jendela Terminal bun add @capgo/capacitor-zebra-datawedge -
Sinkronisasi platform native
Jendela Terminal bunx cap sync android -
Konfigurasi DataWedge pada perangkat
- Buat atau pilih profil Zebra DataWedge yang terkait dengan paket aplikasi Anda.
- Aktifkan
Intent Output. - Atur
Intent deliverykeBroadcast Intent. - Pilih aksi seperti
app.capgo.zebra.SCAN.
-
Ulas perilaku Android
- Baca catatan sebelum mengaktifkan pengaktifan lembut di produksi. Pengaturan dasar
Bagian berjudul “Pengaturan dasar”
Salin ke clipboardimport { DataWedgeConfigMode, DataWedgePlugin, ZebraConfiguration, ZebraDataWedge, ZebraRuntime,} from '@capgo/capacitor-zebra-datawedge';
const intentAction = 'app.capgo.zebra.SCAN';
await ZebraConfiguration.setConfig({ profileName: 'CapgoZebraProfile', profileEnabled: true, configMode: DataWedgeConfigMode.CREATE_IF_NOT_EXIST, appList: [ { packageName: 'com.example.app', activityList: ['*'], }, ], pluginConfigs: [ { pluginName: DataWedgePlugin.BARCODE, resetConfig: true, paramList: { scanner_selection: 'auto', scanner_input_enabled: 'true', }, }, { pluginName: DataWedgePlugin.INTENT, resetConfig: true, paramList: { intent_output_enabled: 'true', intent_action: intentAction, intent_delivery: 2, }, }, ],});
await ZebraDataWedge.addListener('scan', (result) => { console.log('Scanned', result.data, result.labelType);});
const result = await ZebraRuntime.softScanTrigger(intentAction);console.log(result.data);Kelompok runtime utama
Judul bagian “Kelompok runtime utama”ZebraConfigurationmenangani profil dan pengaturan aplikasi yang dinonaktifkan.ZebraNotificationmendaftar untuk siaran DataWedge seperti status scanner dan perubahan profil.ZebraQuerymembaca profil aktif, aplikasi terkait, status scanner, daftar scanner, dan informasi versi.ZebraRuntimemengaktifkan atau menonaktifkan DataWedge, mengganti scanner, dan mengaktifkan scan.
Lingkup platform
Judul bagian “Lingkup platform”- Android: sepenuhnya didukung pada perangkat Zebra dengan DataWedge terinstal.
- iOS: tidak tersedia karena DataWedge hanya spesifik Android Zebra.
- Web: tidak tersedia di luar kesamaan bentuk API.
Teruskan dari Getting Started
Bagian berjudul “Teruskan dari Getting Started”Jika Anda menggunakan Getting Started untuk merencanakan pekerjaan plugin native, hubungkannya dengan Menggunakan @capgo/capacitor-zebra-datawedge untuk kemampuan native di Menggunakan @capgo/capacitor-zebra-datawedge, Direktori Plugin Capgo untuk alur kerja produk di Direktori Plugin Capgo, Plugin-Plugin Capacitor oleh Capgo untuk detail implementasi di Plugin-Plugin Capacitor oleh Capgo, Menambahkan atau Mengupdate Plugin untuk detail implementasi di Menambahkan atau Mengupdate Plugin, dan Alternatif Plugin Perusahaan Ionic untuk alur kerja produk di Alternatif Plugin Perusahaan Ionic.