Can HTML5 access NFC chips on mobile phones

前端 未结 2 1067
梦如初夏
梦如初夏 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

    0 讨论(0)
  • 2021-02-04 09:45

    If you are using Phonegap 3.0 and the Cordova CLI you can easily integrate RFID reading capabilities through NFC by using Chariot Solutions Phonegap NFC plugin from Github and following the steps laid out by Øystein Heimark/Dogu in the referenced blog post.

    Github: Github repository

    Blog: ADDING RFID CAPABILITIES TO YOUR ANDROID PHONEGAP APPLICATION

    0 讨论(0)
提交回复
热议问题