反应本机 NFC reader

React native NFC reader

同样的问题 react-native-nfc can't detect Mifare DESfire 从这里 read NFC tags in React Native app

应用程序构建没有任何问题,已启动,但在这段代码之后,没有任何信息,没有任何错误,什么都没有,商店中的另一个应用程序可以毫无问题地检测到 NFC 标签,但没有反应,有人能帮忙吗?

NFC.addListener((payload)=>{
    alert(payload.data.id);
})

解决方案:需要安装两个库并使用第一个

https://github.com/Novadart/react-native-nfc

https://github.com/observ3r/nfc-ndef-react-native