I'm creating an NFC mobile app (React-Native) for receiving and sending Ndef messages between an rc532, connected to an Arduino Uno, and the smartphone.
To send data from the smartphone to the Arduino, I used the Android Beam communication mode. I have problems receiving data, or rather reading from the smartphone.
On the Arduino I simulate a card, the mobile app reads the tag but not the content, that is the Ndef message, returns it to me as "undefine" or "null".
The library I used is the following: https://github.com/whitedogg13/react-native-nfc-manager.
This is my data reading code:
readData = async () => {
NfcManager.start();
NfcManager.setEventListener(NfcEvents.DiscoverTag, tag => {
console.log('tag', tag);
console.log(NfcManager.getCachedNdefMessageAndroid(tag));
console.log(this.parseText(tag));
console.log(JSON.stringify(tag.data));
//NfcManager.unregisterTagEvent().catch(() => 0);
});
}
What it returns is:
[Thu Jan 21 2021 13:46:10.960] LOG Running "projectNFC2" with {"rootTag":1} [Thu Jan 21 2021 13:46:13.182] LOG tag {"id": "0000000000000000", "techTypes": ["android.nfc.tech.NfcF"]}
[Thu Jan 21 2021 13:46:13.215] LOG {"_U": 0, "_V": 0, "_W": null, "_X": null}
[Thu Jan 21 2021 13:46:13.219] LOG null
[Thu Jan 21 2021 13:46:13.221] LOG undefined
[Thu Jan 21 2021 13:46:15.200] WARN Possible Unhandled Promise Rejection (id: 0): "no tech request available"
Does anyone have any ideas or solutions to my problem?