An open API service indexing awesome lists of open source software.

https://github.com/mybigday/react-native-tsc-printer


https://github.com/mybigday/react-native-tsc-printer

Last synced: 5 days ago
JSON representation

Awesome Lists containing this project

README

          

# react-native-tsc-printer

TSC printer module for React Native

## Installation

```sh
npm install react-native-tsc-printer
```

## Android

Add the following to your `AndroidManifest.xml`:

```xml

```

Add `android/src/main/res/xml//device_filter.xml`

```xml

```

## iOS

Add the following to your `Info.plist`:

```xml
NSBluetoothAlwaysUsageDescription
Need bluetooth access for printing
NSBluetoothPeripheralUsageDescription
Need bluetooth access for printing
UISupportedExternalAccessoryProtocols

com.issc.datapath

```

## Enabling TSC USB Functionality

The TSC USB functionality is conditionally compiled. You can enable it using one of the following methods:

### Method 1: Environment Variable

Set the `ENABLE_TSC_USB` environment variable to `1` before running pod install:

```sh
ENABLE_TSC_USB=1 pod install
```

### Method 2: Package.json Configuration

Add the `tscUsbEnabled` property to your project's root `package.json` file:

```json
{
"name": "your-app",
"version": "1.0.0",
"tscUsbEnabled": true
}
```

## Usage

```js
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();
```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---

Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)