Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-native-blue-print

bhanuc5MIT0.1.0

Easy Thermal Printing from Android.

react-native

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

  1. 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 the getPackages() method
  2. 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')
  3. Insert the following lines inside the dependencies block in android/app/build.gradle:
       compile project(':react-native-blue-print')
  4. 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");