Reading NFC into web application

1.4k Views Asked by At

I am building a web application, which should read information from an NFC reader connected through USB. It is supposed to work on windows desktop and linux. I need a method similar to Web NFC API, which is great for my purpose. Unfortunately, it is only for Android. They plan to support other platforms in the future, but when?

The next option, I explored, was WebHID. See https://web.dev/hid. But my device ACR122U is not supported.

Then I tried WebUSB API, but with the same result as here and here.

Failed to execute 'claimInterface' on 'USBDevice': The requested interface implements a protected class

. Here is the reason.

I´ve read many posts here, but found no solution.

Is there any stable and robust solution (like Web NFC)?

1

There are 1 best solutions below

0
On

It seems like you did everything right according to https://web.dev/devices-introduction/#discover,

  1. Check Web NFC: It is supported on Android only for now.
  2. Fallback to WebHID: ACR122U does not support HID.
  3. And finally check WebUSB: Smart card interface access is blocked.

Your best bet is to wait for the potentially upcoming Smart Card Web API. Check out https://github.com/WICG/proposals/issues/64