使用 @capgo/capacitor-zebra-datawedge
Capacitor 插件专为 Zebra Android 设备设计,用于 Zebra DataWedge 配置管理、通知、查询及软扫描。
安装
bun add @capgo/capacitor-zebra-datawedge
bunx cap sync
bunx cap sync 将插件的原生 code 复制到你的原生项目中。每次升级插件后都要重新运行。
导入
import { ZebraDataWedge } from '@capgo/capacitor-zebra-datawedge';
API 概览
| 方法 | 描述 |
|---|---|
cloneProfile |
查看源码定义以了解当前行为。 |
createProfile |
查看源码定义以了解当前行为。 |
deleteProfile |
查看源码定义以了解当前行为。 |
importConfig |
查看源码定义以了解当前行为。 |
renameProfile |
查看源码定义以了解当前行为。 |
restoreConfig |
查看源码定义以了解当前行为。 |
setConfig |
查看源码定义以了解当前行为。 |
setDisabledAppList |
查看源码定义以了解当前行为。 |
setIgnoreDisabledProfiles |
查看源码定义以了解当前行为。 |
registerForNotification |
查看源码定义以了解当前行为。 |
unRegisterForNotification |
查看源码定义以了解当前行为。 |
enumerateScanners |
查看源码定义以了解当前行为。 |
getActiveProfile |
查看源码定义以了解当前行为。 |
getAssociatedApps |
查看源码定义以了解当前行为。 |
getConfig |
查看源码定义以了解当前行为。 |
getDatawedgeStatus |
查看源码定义以了解当前行为。 |
getDisabledAppList |
查看源码定义以了解当前行为。 |
getIgnoreDisabledProfiles |
查看源码定义以了解当前行为。 |
getProfilesList |
查看源码定义以了解当前行为。 |
getScannerStatus |
查看源码定义以了解当前行为。 |
getVersionInfo |
查看源码定义以了解当前行为。 |
disableDatawedge |
查看源码定义以了解当前行为。 |
disableScannerInput |
查看源码定义以了解当前行为。 |
enableDatawedge |
查看源码定义以了解当前行为。 |
enableScannerInput |
查看源码定义以了解当前行为。 |
enumerateTriggers |
查看源码定义以了解当前行为。 |
notify |
查看源码定义以了解当前行为。 |
resetDefaultProfile |
查看源码定义以了解当前行为。 |
setDefaultProfile |
查看源码定义以了解当前行为。 |
setReportingOptions |
查看源码定义以了解当前行为。 |
softRfidTrigger |
查看源码定义以了解当前行为。 |
softScanTrigger |
查看源码定义以了解当前行为。 |
switchScanner |
查看源码定义以了解当前行为。 |
switchScannerParams |
查看源码定义以了解当前行为。 |
switchToProfile |
查看源码定义以了解当前行为。 |
示例
cloneProfile()
查看 API 参考文档以了解当前契约。
import { ZebraDataWedge } from '@capgo/capacitor-zebra-datawedge';
await ZebraDataWedge.cloneProfile({
destProfileName: 'dest-profile',
sourceProfileName: 'source-profile',
});
createProfile()
查看 API 参考文档以了解当前契约。
import { ZebraDataWedge } from '@capgo/capacitor-zebra-datawedge';
await ZebraDataWedge.createProfile({ profileName: 'profile' });
deleteProfile()
查看 API 参考文档以了解当前契约。
import { ZebraDataWedge } from '@capgo/capacitor-zebra-datawedge';
await ZebraDataWedge.deleteProfile({ profileNames: ['profile'] });
importConfig()
查看 API 参考文档以了解当前契约。
import { ZebraDataWedge } from '@capgo/capacitor-zebra-datawedge';
await ZebraDataWedge.importConfig({ folderPath: 'path/to/file' });
renameProfile()
查看 API 参考文档以了解当前契约。
import { ZebraDataWedge } from '@capgo/capacitor-zebra-datawedge';
await ZebraDataWedge.renameProfile({
currentProfileName: 'current-profile',
newProfileName: 'new-profile',
});
restoreConfig()
查看 API 参考文档以了解当前契约。
import { ZebraDataWedge } from '@capgo/capacitor-zebra-datawedge';
await ZebraDataWedge.restoreConfig();
上表列出了 35 个核心方法。Listener 和版本辅助函数,以及每个方法的完整约定,详见 GitHub 仓库.
监听事件
addListener 会返回一个句柄。调用 handle.remove() 当屏幕卸载时。
完整参考文档
继续阅读 使用 @capgo/capacitor-zebra-datawedge
如果你正在使用 使用 @capgo/capacitor-zebra-datawedge 要规划原生插件工作,请将其与 @capgo/capacitor-zebra-datawedge 了解 @capgo/capacitor-zebra-datawedge 中的实现细节, 快速入门 有关“入门指南”中的实现细节, Capgo 插件目录 查看 Capgo 插件目录中的产品工作流, Capgo 提供的 Capacitor 插件 有关 Capgo 开发的 Capacitor 插件的实现细节,以及 添加或更新插件 有关添加或更新插件的实现细节。