JSPM

react-native-zebra-rfid

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8
  • Score
    100M100P100Q45856F
  • License MIT

React native zebra RIFD for Android

Package Exports

  • react-native-zebra-rfid

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-zebra-rfid) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

React native RFID reader

for Zebra RFD8500 reader

React-native module for scanning RFID tags with Zebra RFD8500

Install:

Install the module

npm install --save react-native-zebra-rfid

Link native dependencies

react-native link

Add the node_modules library directory in repositories under build.gradle, e.g. (added the flatDir line):

allprojects {
    repositories {
        google()
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        // Manually added for react-native-zebra-rfid
        flatDir { dirs "$rootDir/../node_modules/react-native-zebra-rfid/android/libs" }
    }
}

This module includes the Zebra RFID API3_SDK_2.0.0.2.aar file included. Depending on your setup you may need to override some settings in the aar, e.g. minsdk or allowBackup, in the android manifest.

Usage:

import RFIDScanner, { RFIDScannerEvent } from 'react-native-zebra-rfid';

// Init and connect
RFIDScanner.init();

// Register callback
RFIDScanner.on(RFIDScannerEvent.TAGS, onRfidResult);

// Remove callback
RFIDScanner.removeon(RFIDScannerEvent.TAGS, onRfidResult);

// Shutdown
RFIDScanner.shutdown();

// Callback, tags is an array of strings
// Read triggered by hardware trigger, or 
// programmatically by calling
// RFIDScanner.read() or RFIDScanner.cancel()

const onRfidResult = (tags) => {
    console.info(' TAGS: ' + JSON.stringify(tags));
}