Skip to content

Latest commit

 

History

History
79 lines (56 loc) · 1.29 KB

README.md

File metadata and controls

79 lines (56 loc) · 1.29 KB

react-native-rfid-handle

RFID component for react native, only works Android. If you find this package useful hit the star with <3

Installation

Step 1

yarn add https://github.com/LongNguyen2312/react-native-rfid-handle.git

Step2

Refers to your JS files

  import rfidModule from 'react-native-rfid-handle';

Usage and APIs

Scan devices BLE

  rfidModule.ScanBLE()

Stop scan devices BLE

  rfidModule..stopScanBLE()

Connect devices BLE

   rfidModule.connectAddress('address').then(res => {
     // res is divices infomation connected
    });

Start read RFID

  rfidModule..startScanRFID()

Stop read RFID

  rfidModule.stop()

Clear RFID

  rfidModule.clearData().then(res => {
    //res == true =>  done
    //res != true =>  fail
  })

EVENT LISTENER

Listen devices infomation BLE

  DeviceEventEmitter.addListener('ScanBLEListenner', res => {
    // res is the information of a device when found
  })

Listen RFID

  DeviceEventEmitter.addListener('ReadRFIDListenner', res => {
    // res is the information of a RFID tag when found
  })