0
votes

I've been trying to send text messages in a React-Native app using mainly this this NFC Manager. But instead of the displaying the message text the reading device tries to open the to open the writing app or search for it in the Play Store. The NDEF message consists of two records:

  1. Url: http://play.google.com/store/apps/details?id=com.myapp&feature=beam
  2. External: com.myapp

It seems to ignore the original message completely. A test with this module brought the exact same result. The Devices used were a HTC One M8 and a Samsung Galaxy S4 Mini. Does somebody have experience with NFC Peer to Peer connections and can help me?

2

2 Answers

0
votes

To read the tag you need to register the read callback in your component. I did in the componentWillMount function (don't forget to cancel the listener in componentWillUnmount). The sample code from the Readme works:

NfcManager.registerTagEvent(tag => {
    console.log('Tag Discovered', tag);
}, 'Hold your device over the tag', true)
0
votes

React-native-nfc-manager does not support peer to peer nfc data sharing any more which means that if you have to transfer data between two physical mobile phones using NFC, its not possible to do it. NFC tags to phone or phone to NFC Tags are supported. You can read more about this here.

But there is another library react-native-hce that can be helpful in doing the same. Current credit card payment via mobile phone like apple pay is entirely based on Host Card emulation which is advance version of NFC tech.

You can read more about HCE from here.