Panduan Memulai
Salin prompt setup yang berisi langkah install 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.
Instalasi
Bagian berjudul “Instalasi”Anda bisa menggunakan AI-Assisted Setup kami untuk menginstal plugin ini. Tambahkan skill Capgo ke tool AI Anda dengan command berikut:
bunx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsLalu gunakan prompt berikut:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-zebra-datawedge` plugin in my project.Jika Anda lebih memilih Manual Setup, instal plugin dengan menjalankan perintah berikut dan ikuti petunjuk khusus platform di bawah ini:
-
Install 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 terhubung dengan package app Anda.
- Aktifkan
Intent Output. - Atur
Intent deliverykeBroadcast Intent. - Pilih sebuah aksi seperti
app.capgo.zebra.SCAN.
-
Tinjau perilaku Android
- Baca Catatan Android sebelum mengaktifkan soft trigger di produksi.
Mulai cepat
Bagian berjudul “Mulai cepat”import { ZebraDataWedge } from '@capgo/capacitor-zebra-datawedge';
await ZebraDataWedge.cloneProfile({ destProfileName: 'dest-profile', sourceProfileName: 'source-profile',});Contoh: createProfile
Bagian berjudul “Contoh: createProfile”import { ZebraDataWedge } from '@capgo/capacitor-zebra-datawedge';
await ZebraDataWedge.createProfile({ profileName: 'profile' });Contoh: deleteProfile
Bagian berjudul “Contoh: deleteProfile”import { ZebraDataWedge } from '@capgo/capacitor-zebra-datawedge';
await ZebraDataWedge.deleteProfile({ profileNames: ['profile'] });Kesalahan umum
Bagian berjudul “Kesalahan umum”- Listeners: hapus handle saat screen unmount.
- Sinkronisasi Native: jalankan
bunx cap syncsetelah upgrade plugin. - Sumber kebenaran tunggal: percayai
src/definitions.tsdi repo GitHub.
Setup dasar
Bagian berjudul “Setup dasar”import { 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);Grup runtime utama
Bagian berjudul “Grup runtime utama”ZebraConfigurationmengelola profil dan pengaturan disabled-app.ZebraNotificationmendaftarkan broadcast notifikasi DataWedge seperti status scanner dan perpindahan profil.ZebraQuerymembaca profil aktif, aplikasi terkait, status scanner, daftar scanner, dan info versi.ZebraRuntimemengaktifkan atau menonaktifkan DataWedge, mengganti scanner, dan memicu pemindaian.
Cakupan Platform
Bagian berjudul “Cakupan Platform”- Android: didukung penuh pada perangkat Zebra dengan DataWedge terinstal.
- iOS: tidak tersedia karena DataWedge khusus untuk Android Zebra.
- Web: tidak tersedia selain kesamaan bentuk API.
Lanjutkan dari Getting Started
Bagian berjudul “Lanjutkan dari Getting Started”Jika Anda menggunakan Panduan Memulai untuk merencanakan pekerjaan plugin native, hubungkan dengan Menggunakan @capgo/capacitor-zebra-datawedge untuk kemampuan native dalam Menggunakan @capgo/capacitor-zebra-datawedge, Direktori Plugin Capgo untuk alur kerja produk di Direktori Plugin Capgo, Plugin Capacitor oleh Capgo untuk detail implementasi pada Capacitor Plugins oleh Capgo Menambahkan atau Memperbarui Plugin untuk detail implementasi di Menambahkan atau Memperbarui Plugin, dan Alternatif Plugin Ionic Enterprise untuk alur kerja produk dalam Alternatif Plugin Ionic Enterprise.