TSC printer module for React Native
npm install react-native-tsc-printer
Add the following to your AndroidManifest.xml
:
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"/>
Add the following to your Info.plist
:
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Need bluetooth access for printing</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Need bluetooth access for printing</string>
<key>UISupportedExternalAccessoryProtocols</key>
<array>
<string>com.issc.datapath</string>
</array>
import Printer, { ConnectionType } from 'react-native-tsc-printer';
// ...
const printer = await Printer.connect(ConnectionType.USB, '1234567890');
await printer.addText(0, 0, 'Hello, world!');
await printer.print();
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library