File tree Expand file tree Collapse file tree 1 file changed +33
-5
lines changed
Expand file tree Collapse file tree 1 file changed +33
-5
lines changed Original file line number Diff line number Diff line change @@ -5,20 +5,48 @@ React Native Android module to interface with Zebra's DataWedge using Android In
55## Installation
66
77``` sh
8- npm install react-native-datawedge-intents
8+ npm install @edritech93/ react-native-datawedge-intents
99```
1010
1111## Usage
1212
13+ init scanner and listen
1314
14- ``` js
15- import { multiply } from ' react-native-datawedge-intents' ;
15+ ``` ts
16+ import {
17+ ScannerInit ,
18+ ScannerReceiver ,
19+ } from ' @edritech93/react-native-datawedge-intents' ;
1620
1721// ...
1822
19- const result = await multiply (3 , 7 );
20- ```
23+ const eventEmitter = new NativeEventEmitter ();
24+
25+ // ...
2126
27+ const profileConfig: ProfileConfigType = {
28+ name: ' Example' ,
29+ package: ' datawedgeintents.example' ,
30+ };
31+ ScannerInit (profileConfig );
32+ const subscription = eventEmitter .addListener (
33+ ' datawedge_broadcast_intent' ,
34+ _broadcastReceiverHandler
35+ );
36+ return () => {
37+ subscription .remove ();
38+ };
39+
40+ // ...
41+
42+ const _broadcastReceiverHandler = (intent : any ) => {
43+ const objResult = ScannerReceiver (intent );
44+ // get data here
45+ console .log (objResult .data );
46+ };
47+
48+ // ...
49+ ```
2250
2351## Contributing
2452
You can’t perform that action at this time.
0 commit comments