revtel / react-native-nfc-manager

React Native NFC module for Android & iOS
MIT License
1.36k stars 317 forks source link

Mifare Classic is not working #572

Closed gshoanganh closed 1 year ago

gshoanganh commented 1 year ago

i tried your example, it doesn't seem to work. your ex: AndroidMifareClassic.js at line 263, it actually stopped. (follow the arrow.)

this.setState({ isDetecting: true });
    NfcManager.registerTagEvent(tag => console.log(tag))
      .then(() => NfcManager.requestTechnology(NfcTech.MifareClassic))
      .then(() => NfcManager.getTag())
      .then(tag => {
        this.setState({ tag });
        return NfcManager.mifareClassicGetSectorCount();  ///<-------- stopped
      })
      .then(sectorCount => {
        this.setState({ sectorCount });
      })
      .then(() => {
        let sector = parseInt(this.state.sector);
        if (isNaN(sector)) {
          this.setState({ sector: '0' });
          sector = 0;
        }

this is the result i get: {"techTypes":["android.nfc.tech.NfcA","android.nfc.tech.MifareClassic","android.nfc.tech.NdefFormatable"],"id":"NNNNNN"}

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 5 days with no activity.

cgbsolutions commented 10 months ago

It looks like this issue is still preset in the example code, any chance of an updated example with this resolved?