Can HTML5 access NFC chips on mobile phones

前端 未结 2 1129
梦如初夏
梦如初夏 2021-02-04 09:03

I\'m not too familiar with HTML5 so does anyone know if HTML5 will be able to access NFC chips built into mobile devices? Or, can someone suggest another way to do this using so

2条回答
  •  忘掉有多难
    2021-02-04 09:34

    NFC access via some proprietary framework may be possible, but I don't think it's currently built into the HTML 5 spec itself.

    PhoneGap uses HTML5 for the main UI of the mobile application, and then takes specific code that you write (javascript API I think), which is then translated into native code for each of the mobile devices it is ported to. So, one option you have is building your main UI in HTML5, and then displaying that in a WebView or equivalent inside a native application, then accessing NFC specific features via the native application and passing it to your webapp via a dynamic URL like http://mysampleapp.com/NFC/somestringofdatafromthenfcthatiwillparsetouseinmyhtml5app

提交回复
热议问题