关于微信NFC功能开发的链接总结,不需要你再一篇篇辛苦的找!!
特此申明:若有侵权,请联系我,我会第一时间删除
一. 小程序开发一般流程:
-
首先调用 wx.getHCEState(OBJECT), 判断设备是否支持NFC,(ios,android兼容性处理)
-
调用 wx.startHCE(OBJECT) 初始化手机的NFC模块;
-
初始化完成后,调用 wx.onHCEMessage(CALLBACK) 监听芯片响应的消息;
-
点击页面上的“询卡”按钮,调用 wx.sendHCEMessage(OBJECT)发送询卡指令;
-
这时 wx.onHCEMessage(CALLBACK) 应该可以收到带有uid信息的芯片响应数据;
-
根据uid发送select指令,以及后续多个指令;
-
全部操作完成后之后,调用 wx.stopHCE(OBJECT) 停止手机的NFC模块
二. 纯干货来啦! 代码链接,仅供参考!
-
https://github.com/whitedogg13/react-native-nfc-manager(react-native)
-
https://stackoverflow.com/questions/41466773/react-native-android-read-nfc-card-id
三. 你可能用到的参考代码,啥也不说,直接上链接。
-
https://www.phodal.com/blog/arduino-nfc-pn532-dfrobot-pn532-nfc/
-
http://www.360doc.com/content/11/0524/13/474846_119019554.shtml
-
https://blog.csdn.net/ieeso/article/details/106219861(uni-app 利用native调用Android NFC 读取RFID标签的UID)
-
nctive的SDK调用:
-
小程序NFC - API:
-
https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/wx.stopHCE.html
-
JavaScript 通过native.js 调用Android原生API:
-
关于android原生开发:
-
https://developer.android.google.cn/reference/android/nfc/NfcAdapter
-
https://blog.csdn.net/weixin_33757609/article/details/92834998
-
https://blog.csdn.net/qq_26787115/article/details/50831582?_t=t(初次开发应该注意事项:)
-
相关插件:
-
微信开发公众号页面配置JS-SDK调用微信接口:
-
https://blog.csdn.net/weixin_38571379/article/details/94577104
-
UNI-APP开发微信公众号(H5)JSSDK调式:
-
node.js开发微信公众号: