https://github.com/mybigday/react-native-tsc-printer
https://github.com/mybigday/react-native-tsc-printer
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mybigday/react-native-tsc-printer
- Owner: mybigday
- License: mit
- Created: 2024-12-11T05:04:57.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-06-09T04:38:54.000Z (4 months ago)
- Last Synced: 2025-06-09T05:27:09.451Z (4 months ago)
- Language: TypeScript
- Size: 1.48 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
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
UISupportedExternalAccessoryProtocolscom.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)