Ionic nfc.connect

Hi,

my ionic info

Ionic:

ionic (Ionic CLI)             : 4.11.0 
   Ionic Framework               : @ionic/angular 4.1.0
   @angular-devkit/build-angular : 0.13.5
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.3.5
   @ionic/angular-toolkit        : 1.4.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 5 other plugins)

System:

   Android SDK Tools : 26.1.1 
   NodeJS            : v10.15.3 
   npm               : 6.4.1
   OS                : Windows 10

i want to send some commands to nfc tag and get response. Reading tag event firing without problem

this.nfc.addTagDiscoveredListener(() => {
        console.log('successfully attached addTagDiscoveredListener listener');
      }, (err) => {
        console.log('error attaching addTagDiscoveredListener listener', err);
      }).subscribe((event) =>  {
         this.nfc.connect('android.nfc.tech.NfcA', 500).then(
            () => console.log('connected to', this.nfc.bytesToHexString(event.tag.id)),
            (error) => console.log('connection failed', error)
        );
        console.log('received addTagDiscoveredListener message. the tag contains: ', event.tag);
        console.log('decoded tag id', this.nfc.bytesToHexString(event.tag.id));
           
      });

this.nfc.connect this line debugger says “Property ‘connect’ does not exist on type ‘NFC’”. i couldnt solve this problem

how can i send some commands to nfc tag is there any sample about this?

Hi madsmile

I had the same problem as you, so I decided to write my own small plugin. I took most of the code from the plugin you mentioned, the connect, transceive and close functions were just commented out, or implemented, but not exposed to the ionic native plugin.

You can find my solution with a (hopefully) useful instruction on how to install and use it on my github repository:

I hope i could help somebody with this

by the way, i took nearly all the code from the plugin you mentioned, so the credit goes to them :slight_smile:

Hi, do you know someone who made a plugin for Mifare Classic tags?

@sebafra0 did you found it ? iam also looking for the same . Please share if you found any resources