pokusew / nfc-pcsc

Easy reading and writing NFC tags and cards in Node.js
MIT License
535 stars 132 forks source link

Read NFC tag from Android device(s) with Node.js and nfc-pcsc package #127

Open kwoxer opened 2 years ago

kwoxer commented 2 years ago

I have an Node.js express application that needs to be available on an Android device and being able to access the NFC reader of that device. That NFC shall be used to authenticate the user to my application.

So my idea was to use the nfc-pcsc package. But when I run that it takes the NFC of my server, as expected. But I wondered about why my PC where it runs at has NFC? Anyway here is the reader that was detected:

frontpage loaded
device attached Reader {
  _events: [Object: null prototype] {},
  _eventsCount: 0,
  _maxListeners: undefined,
  reader: CardReader {
  ...

So how to let the NFC package run on the device on client-side? Is this even possible due to security restrictions of the Android OS?

And finally I need multiple tablets with that app, so it would be great if the solution is not resulting in setting up something hard-coded on all of the tablets.