Skip to content

Repository files navigation

@countertek/react-native-esc-pos-printer

Expo native module for Epson TM ESC/POS printers.

Discovery is available through PrintersDiscovery and usePrintersDiscovery. Printer sessions and printing are not implemented yet.

Discovery

Add the package to the Expo app's plugins array, rebuild the development client, then request permission before starting Discovery:

import {
  PrintersDiscovery,
  getDiscoveryPermissions,
  requestDiscoveryPermissions,
} from '@countertek/react-native-esc-pos-printer';

const current = await getDiscoveryPermissions();
if (!current.granted) {
  await requestDiscoveryPermissions();
}

PrintersDiscovery.start();

Subscribe with PrintersDiscovery.onDiscovery, onStatusChange, and onError, or use usePrintersDiscovery for React state. granted reports Bluetooth; start Discovery even when it is false so LAN and USB printers can still be found. The config plugin writes the required Bluetooth, local-network, and external-accessory permission entries.

Documentation

Development

Install the library dependencies:

pnpm install

Install and run the Expo SDK 56 example:

cd example
pnpm install
pnpm ios
# or
pnpm android

The example uses Expo Router and a development client. Expo Go is not supported because this package contains native modules.

License

MIT

About

[Working on] Epson ECS POS Printer to rescue abandoned original repo and fixes issues and make it work

Resources

Code of conduct

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages