com-easystep2-datawedge-plugin-intent-capacitor 4.3.2 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Easystep2 DataWedge Plugin (Capacitor)
|
|
2
|
+
|
|
3
|
+
A Capacitor plugin for Android Intents that integrates with Zebra DataWedge.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install com-easystep2-datawedge-plugin-intent-capacitor
|
|
9
|
+
npx cap sync
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Platforms
|
|
13
|
+
|
|
14
|
+
- Android
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { IntentShim } from 'com-easystep2-datawedge-plugin-intent-capacitor';
|
|
20
|
+
|
|
21
|
+
// Register for barcode scan broadcast
|
|
22
|
+
async function registerDataWedgeBroadcastReceiver() {
|
|
23
|
+
await IntentShim.registerBroadcastReceiver({
|
|
24
|
+
filterActions: ['com.symbol.datawedge.api.RESULT_ACTION']
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// Listen for broadcasts
|
|
28
|
+
IntentShim.addListener('broadcastReceived', (intent) => {
|
|
29
|
+
if (intent.extras && intent.extras.com_symbol_datawedge_data_string) {
|
|
30
|
+
// Process barcode data
|
|
31
|
+
const barcodeData = intent.extras.com_symbol_datawedge_data_string;
|
|
32
|
+
console.log('Scanned barcode:', barcodeData);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Configure DataWedge profile
|
|
38
|
+
async function configureDataWedgeProfile() {
|
|
39
|
+
await IntentShim.sendBroadcast({
|
|
40
|
+
action: 'com.symbol.datawedge.api.ACTION',
|
|
41
|
+
extras: {
|
|
42
|
+
'com.symbol.datawedge.api.CREATE_PROFILE': 'MyProfile',
|
|
43
|
+
'com.symbol.datawedge.api.PROFILE_CONFIG': {
|
|
44
|
+
'PLUGIN_CONFIG': {
|
|
45
|
+
'BARCODE_PLUGIN': {
|
|
46
|
+
'SCANNER_SELECTION': 'auto',
|
|
47
|
+
'SCANNER_INPUT_ENABLED': true
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
'APP_LIST': [{
|
|
51
|
+
'PACKAGE_NAME': 'io.ionic.myapp', // Replace with your app's package name
|
|
52
|
+
'ACTIVITY_LIST': ['*']
|
|
53
|
+
}]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## API
|
|
61
|
+
|
|
62
|
+
### IntentShim
|
|
63
|
+
|
|
64
|
+
#### Methods
|
|
65
|
+
|
|
66
|
+
- `registerBroadcastReceiver(options: { filterActions: string[] }): Promise<void>`
|
|
67
|
+
- `unregisterBroadcastReceiver(): Promise<void>`
|
|
68
|
+
- `sendBroadcast(options: { action: string; extras?: any }): Promise<void>`
|
|
69
|
+
- `startActivity(options: { action: string; url?: string; type?: string; extras?: any }): Promise<void>`
|
|
70
|
+
- `getIntent(): Promise<{ action: string; data: string; type: string; extras: any }>`
|
|
71
|
+
- `startActivityForResult(options: { action: string; url?: string; type?: string; extras?: any; requestCode: number }): Promise<void>`
|
|
72
|
+
- `sendResult(options: { extras?: any; resultCode?: number }): Promise<void>`
|
|
73
|
+
- `packageExists(packageName: string): Promise<{ exists: boolean }>`
|
|
74
|
+
- `setDebugMode(options: { enabled: boolean }): Promise<void>`
|
|
75
|
+
|
|
76
|
+
#### Listeners
|
|
77
|
+
|
|
78
|
+
- `addListener('broadcastReceived', callback): Promise<PluginListenerHandle>`
|
|
79
|
+
- `addListener('onIntent', callback): Promise<PluginListenerHandle>`
|
|
80
|
+
- `addListener('onActivityResult', callback): Promise<PluginListenerHandle>`
|
|
81
|
+
|
|
82
|
+
#### Constants
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import {
|
|
86
|
+
ACTION_SEND, ACTION_VIEW, EXTRA_TEXT, EXTRA_SUBJECT, EXTRA_STREAM,
|
|
87
|
+
EXTRA_EMAIL, ACTION_CALL, ACTION_SENDTO, ACTION_GET_CONTENT, ACTION_PICK
|
|
88
|
+
} from 'com-easystep2-datawedge-plugin-intent-capacitor';
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Zebra DataWedge Integration
|
|
92
|
+
|
|
93
|
+
For detailed information about integrating with Zebra DataWedge, please refer to:
|
|
94
|
+
- [Official Zebra DataWedge API Documentation](https://techdocs.zebra.com/datawedge/latest/guide/api/)
|
|
95
|
+
- [DataWedge Intent API sample](https://github.com/ZebraDevs/DataWedge-API-Exerciser)
|
|
96
|
+
|
|
97
|
+
## License
|
|
98
|
+
|
|
99
|
+
MIT
|
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|