npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-bluetooth-datecs-printer

v1.1.0

Published

Module to printer in a Datecs bluetooth Printer

Downloads

62

Readme

clear# react-native-bluetooth-datecs-printer

Module to print on Datecs bluetooth printers.

✨ Now compatible with Expo SDK 54 and Android SDK 36!

📚 Documentation

Requirements

  • React Native 0.76+
  • React 18.3+
  • Android SDK 36
  • Android 8.0+ (API 26+)
  • Expo SDK 54 (if using Expo)

Installation

npm install react-native-bluetooth-datecs-printer --save

or

yarn add react-native-bluetooth-datecs-printer

Setup

For Expo Projects (SDK 54)

📖 Complete Expo Setup Guide

  1. Install expo-build-properties:
npx expo install expo-build-properties
  1. Configure app.json:
{
  "expo": {
    "plugins": [
      [
        "expo-build-properties",
        {
          "android": {
            "compileSdkVersion": 36,
            "targetSdkVersion": 36,
            "minSdkVersion": 26,
            "buildToolsVersion": "35.0.0"
          }
        }
      ]
    ],
    "android": {
      "permissions": [
        "BLUETOOTH",
        "BLUETOOTH_ADMIN",
        "BLUETOOTH_CONNECT",
        "BLUETOOTH_SCAN",
        "ACCESS_FINE_LOCATION",
        "ACCESS_COARSE_LOCATION"
      ]
    }
  }
}
  1. Run prebuild:
npx expo prebuild --clean
  1. Run the app:
npx expo run:android

⚠️ Note: This library does NOT work with Expo Go. You must use Expo Prebuild or Development Build.

For React Native CLI Projects

The library uses autolinking, so no manual linking is required for React Native 0.60+.

Android Permissions

Add to your android/app/src/main/AndroidManifest.xml:

<!-- Bluetooth permissions for Android 11 and below -->
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />

<!-- Bluetooth permissions for Android 12 and above -->
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" />

<!-- Location permissions (needed for Bluetooth scanning on Android 11 and below) -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" />

Usage

import { RNBluetoothDatecsPrinter } from 'react-native-bluetooth-datecs-printer';
import { PermissionsAndroid, Platform } from 'react-native';

// Request Bluetooth permissions (Android 12+)
async function requestBluetoothPermissions() {
  if (Platform.OS === 'android' && Platform.Version >= 31) {
    const granted = await PermissionsAndroid.requestMultiple([
      PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT,
      PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN,
    ]);
    return (
      granted['android.permission.BLUETOOTH_CONNECT'] === 'granted' &&
      granted['android.permission.BLUETOOTH_SCAN'] === 'granted'
    );
  }
  return true;
}

// Scan for paired devices
async function scanDevices() {
  await requestBluetoothPermissions();
  const devices = await RNBluetoothDatecsPrinter.getDeviceList();
  console.log('Devices:', devices);
}

// Connect to a device
async function connect(deviceAddress) {
  await RNBluetoothDatecsPrinter.connect(deviceAddress);
  console.log('Connected!');
}

// Print text
async function print() {
  await RNBluetoothDatecsPrinter.printText('Hello World!\n');
}

// Disconnect
async function disconnect() {
  await RNBluetoothDatecsPrinter.disconnect();
}

Complete Example

See examples/ExpoExample.tsx for a complete working example with UI.

API

Methods

  • getDeviceList(): Returns a list of paired Bluetooth devices
  • connect(address: string): Connect to a device by MAC address
  • disconnect(): Disconnect from the current device
  • printText(text: string): Print text
  • printQRCode(data: string, size?: number): Print QR code
  • printBarcode(data: string, type?: number): Print barcode
  • feedPaper(lines?: number): Feed paper

Troubleshooting

Common Issues

  1. "Namespace not specified" error: Make sure you're using the latest version of the library
  2. Bluetooth permissions denied: Request runtime permissions on Android 12+
  3. Build fails: Clean the project with ./gradlew clean or npx expo prebuild --clean
  4. Printer not found: Make sure the printer is paired in Android Bluetooth settings

For more help, see EXPO_SETUP.md

Compatibility

| Package Version | Expo SDK | React Native | Android SDK | |----------------|----------|--------------|-------------| | 1.0.22+ | 54+ | 0.76+ | 36 | | < 1.0.22 | - | 0.72 | 30 |

License

MIT