Is it possible to access NFC API in HTML5 applications?

喜欢而已 提交于 2020-01-10 12:10:52

问题


I have a requirement to include NFC Card reader to read associate ID to authenticate the user for a web app displayed in a touch screen.

Is it possible to use SCM NFC reader module for a web-based app.

Is there any plugin that can we included in the client or server side for this purpose ?

Thanks in advance.


回答1:


The Web NFC API (maintained by the NFC Working Group is currently in draft status. This API is intended to provide access to NFC functionality for HTML5.

BUT

  1. In its current version the NFC Web API does not provide any means to get a tags ID/serial numer/anti-collision identifier (I assume that's what you mean with ID, right?). In fact the API will only provide access to NFC tags through the NDEF abstraction layer.
  2. I don't know of any browser release that currently implements the NFC Web API.

UPDATE

The NFC Working Group was closed after its charter expired (mainly due to lack of support by browser vendors) and is no longer maintaining the specification. Instead there is a Web NFC Community Group now that maintains the Web NFC API specification now.




回答2:


As an update to the above. The latest Chrome Canary for Android does now support WebNFC. Interestingly, the primary Chrome supports the older protocol of the NFC.watch method which allows for data to be read/written but the new one has changed to NFCReader methods which are promise based which you start and stop. The later allows for reading of the ID. https://w3c.github.io/web-nfc/




回答3:


There is an API out there, but there is no browser release supporting this API due to the lack of its development!



来源:https://stackoverflow.com/questions/22860874/is-it-possible-to-access-nfc-api-in-html5-applications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!