
Expo DataWedge
Add Zebra DataWedge capabilities to your Android based Expo application.
Installation
Note: Expo DataWedge only works with Android devices that support Zebra's DataWedge intent broadcasting.
Download
- Using npm:
npm install expo-datawedge
- Using yarn:
Configure for Expo
In the app.json
file for your Expo application, you will need to add expo-datawedge
in the plugins section.
...
"plugins": [
"expo-datawedge"
]
...
Usage
import { useEffect } from 'react';
import { Alert, Platform } from 'react-native';
import * as expoDataWedge from 'expo-datawedge';
...
useEffect(() => {
if (Platform.OS === 'android') {
expoDataWedge.addScanListener((event) => {
Alert.alert('Got Scan', JSON.stringify(event));
})
}
return () => {
}
}, []);
...
Testing
Since DataWedge capabilities are not supported natively by the default Expo Go application, you will need to build a packaged development build of your application to test Expo DataWedge. It is recommended to have your Zebra device plugged into your computer with USB debugging enabled as using the Android emulator does not contain the DataWedge application.
Configuring DataWedge