appidea / react-native-hce

Emulate smart cards inside React-Native application.
MIT License
71 stars 26 forks source link

Unable to Send NDEF message from android 10 to android 12 #22

Open vasilycrespo opened 2 years ago

vasilycrespo commented 2 years ago

Hello, first of all, thank you very much for a great job with this react native library.

I am experiencing the following issue:

I am able to use the HCE library on both android 10 and 12, which are the devices I am testing with.

Both are able to send the HCE message, however android 12 is unable to read the message from android 10.

For example, I can send an NDEF message from android 10 to another android 10 device as a reader.

However, if a try to send the NDEF message from android 10 to a Samsung S22+ with android 12, the reader is unable to receive the NDEF messages, there are no errors on any of the two sides. There is just a small bubble on the HCE side (android 10) which states that there are no apps available to receive the tag.

As a side note I am using this library as a reader:

https://github.com/revtel/react-native-nfc-manager

Also, I tested sending the HCE NDEF message with another google play store library and the message is properly sent from android 10 to 12 with this one:

https://play.google.com/store/apps/details?id=com.maxsoft.ndeftagemulator&hl=en&gl=US

Just wanted to know I anyone has experienced something similar or has any clue of what could be happening. Thanks in advance!

Zardozz commented 1 year ago

It seems that the Type 4 spec is less than clear on the max Ndef size and this might be causing a problem (a theory)

I have no way to test this but this and other HCE libraries are using FFFE as the max size when it should be 80FE see https://stackoverflow.com/questions/75932985/why-does-data-transfer-over-nfc-with-hce-only-work-with-android-lower-12 for more details

appidea commented 1 year ago

@Zardozz Many thanks! It could be the most wanted answer for this question of random behaviour... I will definitely play around with limiting the size of CC and if it will help with compatibility, I will apply the appropriate changes to the next release.

Zardozz commented 1 year ago

As per the stackoverflow question, it seems some success on reducing the CC size to 7FFF has some success as this is a more logical max size of 32K to match physical Tags.

PraneethGunas commented 1 year ago

Any update on this?

IZZAGOLD commented 1 year ago

Any update on this?

yasiragi commented 1 year ago

I'm also looking an update on this, since I'm able to emulate but not able to read the content on another android device scanning using react-native-nfc-manager.