react-native-zplblutooth
This library support for Zebra Printer.
Getting started
$ npm install react-native-zplblutooth --save
Mostly automatic installation
$ react-native link react-native-zplblutooth
Manual installation
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.haka.zplblutooth.RNReactNativeZplblutoothPackage;
to the imports at the top of the file - Add
new RNReactNativeZplblutoothPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-zplblutooth' project(':react-native-zplblutooth').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-zplblutooth/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-zplblutooth')
Usage
; // TODO: What to do with the module?RNReactNativeZplblutooth; consoleconsole on Mount RNZplblutoothRNZplblutooth on Unmount RNZplblutoothRNZplblutooth Check Connection Bluetooth Mac Address From Deviceconst btmac='XX:XX:XX:XX:XX:XX';try let ok = await RNZplblutooth; console; catch error console; Send Command to Printer try let ok=await RNZplblutooth console; catch error console;