react-native-blue-print
v0.1.0
Published
Easy Thermal Printing from Android.
Downloads
6
Readme
react-native-blue-print
Easily print receipts from Bluetooth thermal printers.
Note: This module is currently written for android only due to business requirements. PRs for IOS are welcomed.
Getting started
$ npm install react-native-blue-print --save
Mostly automatic installation
$ react-native link react-native-blue-print
Manual installation
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import io.bhanu.reactnative.RNBluePrintPackage;
to the imports at the top of the file - Add
new RNBluePrintPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-blue-print' project(':react-native-blue-print').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-blue-print/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-blue-print')
- Add the following permission in
android/app/src/main/AndroidManifest.xml
:<uses-permission android:name="android.permission.BLUETOOTH" />
Usage
import RNBluePrint from 'react-native-blue-print';
//inside async fn-
await RNBluePrint.printText("hello world");