react-native-hce icon indicating copy to clipboard operation
react-native-hce copied to clipboard

Unable to Send NDEF message from android 10 to android 12

Open vasilycrespo opened this issue 3 years ago • 8 comments

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!

vasilycrespo avatar Oct 18 '22 17:10 vasilycrespo

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

Zardozz avatar Apr 04 '23 20:04 Zardozz

@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.

appidea avatar Apr 04 '23 21:04 appidea

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.

Zardozz avatar Apr 05 '23 17:04 Zardozz

Any update on this?

PraneethGunas avatar Aug 06 '23 09:08 PraneethGunas

Any update on this?

IZZAGOLD avatar Oct 03 '23 22:10 IZZAGOLD

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.

yasiragi avatar Oct 05 '23 11:10 yasiragi