title: React-Native NFC Reader returns: The NFC tag's type is not supported
body: <p>I am trying to create an android app that will be used to make a payment with an Ingenico terminal. I added the react-native-nfc-manager (<a href="https://github.com/whitedogg13/react-native-nfc-manager" rel="nofollow noreferrer">https://github.com/whitedogg13/react-native-nfc-manager</a>) to my project an followed the v2-ios+android-write-ndef example. I also enabled NFC on my phone. I bought from Amazon an NFC USB reader. I installed it and also got a windows app called GoToTags that connected successfully to the USB module.</p>
  <p>I fired up my app and tested the NFC button.</p>
  <p>The scanner beeps (So the NFC technologie was loaded) but GoToTags sends back a message (The NFC tag's type is not supported) that looks like this:</p>
  <pre><code>{&quot;Uid&quot;:null,&quot;ReadOnly&quot;:false,&quot;DataLength&quot;:null,&quot;CanMakeReadOnly&quot;:false,
  &quot;Formatted&quot;:false,&quot;Records&quot;:null,&quot;TagTech&quot;:null,&quot;MaxDataLength&quot;:null,
  &quot;Exception&quot;:&quot;The NFC tag's type is not supported.&quot;}
  </code></pre>
  <p>I am unsure what I am doing wrong. I followed the instructions to the letter and also watched and followed a YouTube tutorial.</p>
  <p><a href="https://www.youtube.com/watch?v=Kx22B6OH3Oc" rel="nofollow noreferrer">https://www.youtube.com/watch?v=Kx22B6OH3Oc</a></p>
  <p>The only difference between my code and the guy in the YouTube video is that I am using an android phone instead of an iPhone.</p>
  <p>This is my code:</p>
  <pre><code>import React from 'react';
  import { 
    View,
    Text,
    TouchableOpacity,
  } from 'react-native';
  import NfcManager, {Ndef, NfcTech} from 'react-native-nfc-manager';
  
  function buildUrlPayload(valueToWrite) {
      return Ndef.encodeMessage([
          Ndef.uriRecord(valueToWrite),
      ]);
  }
  
  class AppV2Ndef extends React.Component {
    componentDidMount() {
      NfcManager.start();
    }
  
    componentWillUnmount() {
      this._cleanUp();
    }
  
    render() {
      return (
        &lt;View style={{padding: 20}}&gt;
          &lt;Text&gt;NFC Demo&lt;/Text&gt;
          &lt;TouchableOpacity 
            style={{padding: 10, width: 200, margin: 20, borderWidth: 1, borderColor: 'black'}}
            onPress={this._testNdef}
          &gt;
            &lt;Text&gt;Test Ndef&lt;/Text&gt;
          &lt;/TouchableOpacity&gt;
  
          &lt;TouchableOpacity 
            style={{padding: 10, width: 200, margin: 20, borderWidth: 1, borderColor: 'black'}}
            onPress={this._cleanUp}
          &gt;
            &lt;Text&gt;Cancel Test&lt;/Text&gt;
          &lt;/TouchableOpacity&gt;
        &lt;/View&gt;
      )
    }
  
    _cleanUp = () =&gt; {
      NfcManager.cancelTechnologyRequest().catch(() =&gt; 0);
    }
  
    _testNdef = async () =&gt; {
      try {
        let resp = await NfcManager.requestTechnology(NfcTech.Ndef, {
          alertMessage: 'Ready to write some NFC tags!'
        });
        console.warn(resp);
        let ndef = await NfcManager.getNdefMessage();
        console.warn(ndef);
        let bytes = buildUrlPayload('https://www.google.com');
        await NfcManager.writeNdefMessage(bytes);
        console.warn('successfully write ndef');
        await NfcManager.setAlertMessageIOS('I got your tag!');
        this._cleanUp();
      } catch (ex) {
        console.warn('ex', ex);
        this._cleanUp();
      }
    }
  }
  
  export default AppV2Ndef;
  </code></pre>
  <p>What I need to do is send out a 4 digit code to the Ingenico terminal from the phone using the NFC tech. But before I go a head an make that possible, I just want to get the NFC to work first. Sending out <a href="https://google.com" rel="nofollow noreferrer">https://google.com</a> to the card reader would be a good first step. But so fare, no luck.</p>
  <p>What am I missing? It seems pretty much straight forward no?</p>