开始使用
复制一个包含安装步骤和本插件的完整Markdown指南的设置提示。
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.
安装
标题为“安装”您可以使用我们的 AI 助手设置来安装插件。使用以下命令将 Capgo 技能添加到您的 AI 工具中:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins然后使用以下提示:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-zebra-datawedge` plugin in my project.如果您更喜欢手动设置,请运行以下命令安装插件,并按照以下平台特定的说明进行操作:
-
安装插件
终端窗口 bun add @capgo/capacitor-zebra-datawedge -
同步本机平台
终端窗口 bunx cap sync android -
在设备上配置 DataWedge
- 创建或选择与您的应用程序包相关的 Zebra DataWedge 配置文件。
- 启用
Intent Output. - 设置
Intent delivery为Broadcast Intent. - 选择一个动作,如
app.capgo.zebra.SCAN.
-
查看 Android 行为
- 阅读 Android 在生产环境中启用软触发器之前
基本设置
基本设置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);主运行时组
主运行时组ZebraConfiguration__CAPGO_KEEP_0__管理配置文件和禁用应用设置。ZebraNotification__CAPGO_KEEP_0__注册数据韦奇数据广播,例如扫描器状态和配置文件切换。ZebraQuery__CAPGO_KEEP_0__读取活动配置文件、关联应用、扫描器状态、扫描器列表和版本信息。ZebraRuntime__CAPGO_KEEP_0__启用或禁用数据韦奇、切换扫描器和触发扫描。
平台范围
平台范围- Android:在安装了DataWedge的Zebra设备上完全支持。
- iOS:不支持,因为DataWedge是Zebra Android特有的。
- Web:不支持API形状的平面。
继续从Getting Started
继续从Getting Started如果您正在使用 Getting Started 来规划原生插件工作,连接它与 使用@capgo/capacitor-zebra-datawedge 为原生功能在使用@capgo/capacitor-zebra-datawedge Capgo 插件目录 在 Capgo 插件目录中管理产品工作流程 Capacitor 由 Capgo 提供 了解 Capacitor 由 Capgo 提供的实现细节 添加或更新插件 了解添加或更新插件的实现细节 Ionic Enterprise 插件替代方案 了解 Ionic Enterprise 插件替代方案的产品工作流程