
Security News
pnpm 10.16 Adds New Setting for Delayed Dependency Updates
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
@tillpos/rn-receipt-printer-utils
Advanced tools
Fork of react-native-printer. A React Native Library to support USB/BLE/Net printer
Originally forked from react-native-thermal-receipt-printer
A React Native Library to connect to thermal printer over network and to send the buffer (data to be printed) to thermal printer.
yarn add @tillpos/rn-receipt-printer-utils
react-native
version >= 0.60, xcode show this errorduplicate symbols for architecture x86_64
that because the .a library uses CocoaAsyncSocket library and Flipper uses it too
Podfile
...
use_native_modules!
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
# add_flipper_pods!
# post_install do |installer|
# flipper_post_install(installer)
# end
...
and comment out code related to Flipper in ios/AppDelegate.m
Printer | Android | IOS |
---|---|---|
USBPrinter | :x: | :negative_squared_cross_mark: |
BLEPrinter | :heavy_check_mark: | :heavy_check_mark: |
NetPrinter | :heavy_check_mark: | :heavy_check_mark: |
Platform | Framework / lib | Tested |
---|---|---|
Android | React Native | :heavy_check_mark: |
iOS | React Native | :heavy_check_mark: |
To get started with the project, run yarn bootstrap
in the root directory to install the required dependencies for each package:
yarn bootstrap
While developing, you can run the example app to test your changes.
To start the packager:
yarn example start
To run the example app on Android:
yarn example android
To run the example app on iOS:
yarn example ios
To make build
yarn prepare
import {
USBPrinter,
NetPrinter,
BLEPrinter,
} from "@tillpos/rn-receipt-printer-utils";
BLEPrinter.connectAndSend("xx-xx-xx-xx-xx", "<base64>", ()=>null, ()=>null);
NetPrinter.connectAndSend("xx-xx-xx-xx-xx", 9100, "<base64>", ()=>null, ()=>null);
interface INetPrinter {
device_name: string;
host: string;
port: number;
brand?: PrinterBrand;
}
Note: get list device for net printers is support scanning in local ip but not recommended
const printer = {
host: "192.168.10.24",
port: 9100,
device_name: "Sample printer",
brand: PrinterBrand.EPSON
}
_connectPrinter => () => {
//connect printer
await NetPrinter.connectAndSend(
printer.host,
printer.port,
(printer) => console.log("Printed"),
error => console.warn(error)
)
}
render() {
return (
<View style={styles.container}>
{
<TouchableOpacity onPress={(printer) => this._connectPrinter()}>
{`device_name: ${printer.device_name}, host: ${printer.host}, port: ${printer.port}`}
</TouchableOpacity>
))
}
</View>
)
}
...
release-it
to publish buildsFAQs
Fork of react-native-printer. A React Native Library to support USB/BLE/Net printer
We found that @tillpos/rn-receipt-printer-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.