2

I am trying to emulate an NDEF message (NFC Forum Type 4 Tag) using ReactNative. I could not find any working source code or module to achieve this. The only working application is from Maxsoft.bg named NFC NDEF Tag Emulator which is not open source.

So far I've used react-native-nfc-manager and react-native-nfc-hce, but I couldn't make it work.

I also checked the android documentation but I couldn't find a working example/sourcecode there as well.

I found it really strange that I couldn't find even one working source code! So, it would be great if you could help me with a working ReactNative or Android source code.

Nick
  • 95
  • 8
  • 1
    Hello any progress on this one? im trying to do exactly the same thing – mohamed adel Aug 05 '20 at 21:40
  • 1
    The source code provided by @andrew worked just fine. Unfortunately I did not have time to convert this into a React Native module. It shouldn't be that hard! Good luck ;) – Nick Aug 07 '20 at 16:10
  • did react-native-nfc-hce didn't work for you? – mohamed adel Aug 08 '20 at 00:34
  • No! I couldn't make it work. However, I don't know if I was doing something wrong or the package was not working. I also couldn't find any working code sample using react-native-nfc-hce. – Nick Aug 09 '20 at 15:12
  • @HBTB did you manage to make work with react native ??? – Firas Abu Fares May 18 '21 at 08:26
  • @FirasAbuFares Unfortunately not! We had a limited budget for this feature and the PO decided to go another way. As I said it shouldn't be hard to create a react native module out of a [working android application](https://stackoverflow.com/questions/29122848/ndef-message-with-hce-android)! – Nick May 19 '21 at 11:15

1 Answers1

2

NDEF Message with HCE Android should provide you with the answer for Native Java for Android, the best answer also has linked a github repo with source code demo.

Andrew
  • 8,198
  • 2
  • 15
  • 35
  • Thanks. It worked. Now I just have to turn it into a ReactNative module. By any chance, do you know any existing module? – Nick Jul 14 '20 at 15:11
  • in case you're still looking, I learnt a fair bit about creating a react native module from the https://github.com/wix/react-native-newrelic repo. – samazi May 05 '21 at 06:33