Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIDs with iOS13 and Ionic Cordova #380

Closed
JNBG opened this issue Oct 28, 2019 · 6 comments
Closed

UIDs with iOS13 and Ionic Cordova #380

JNBG opened this issue Oct 28, 2019 · 6 comments

Comments

@JNBG
Copy link

JNBG commented Oct 28, 2019

Hi,
tried to create an ios-ionic-cordova app to simply read out an UID from an NFC Chip using this Code:

iosNfcButton.addEventListener('click', function() {
  thisNFC.beginSession((data) => {},
    (err) => {}
      ).subscribe((event) => {
        thisNFC.addNdefListener(() => {
          console.log('connected ndef listener?!')
        }, (err) => {
          console.log('error attaching ndef listener', err);
        }).subscribe((event) => {
         alert(JSON.stringify(event))
        }
      });
    })
  })
});

Baiscally just alert anything from the event in JSON so I can read it without a console. What I got back was:

{
  "isTrusted":false,
    "tag":{
      "ndefMessage":[{
        "tnf": 1,
        "id": [],
        "payload": [33,23,23,2,3],
        "type": [85]
     }]	
  }
}

As you can see the ID is empty. Is there any way I can access this now or maybe in future releases?

@vuptt
Copy link

vuptt commented Nov 7, 2019

@don I just created a forked repo to return the uid, can you check it out and add this feature. Thanks

https://github.com/vuptt/phonegap-nfc

@GeorgeD19
Copy link

GeorgeD19 commented Nov 11, 2019

Great work @vuptt your fork does pull the IDs however when using addTagDiscoveredListener() and scanning an NXP MIFARE Classic 4k (ISO 14443-3A) it is no longer detected. Though I think this is down to apple not bringing compatibility to the MIFARE Classic variants.

Whoever reads this may also like read this article as you'll see other issues on this repo mention accessing the uid will cause your app to be rejected. I could be wrong but it looks like iOS 13 now allows this access.

@vuptt
Copy link

vuptt commented Nov 13, 2019

@GeorgeD19 I don't think addTagDiscoveredListener work on ios.

@GeorgeD19
Copy link

@vuptt I can confirm addTagDiscoveredListener does work on iOS however with the new implementation in your fork it misses out specifically MIFARE classic, it's fine with other tags like MIFARE ultralight. I do not think this any bug though, when I read into it I think apple outright doesn't like MIFARE classic when it comes to grabbing the uid. You can scan MIFARE classic without the uid no problem.

@Patrick-89
Copy link

Hello together. Thank you all for your great work. We are really happy to use your work daily.

But we need to read out the UID of the NFC Chips. But this is now not possible.
Do you have any Idea how this app had solved the issue about scanning out the UID?
https://apps.apple.com/de/app/nfc-tools/id1252962749

Or what is missing in the Cordova plugin in order to read out the NFC UID?

Thank you.

@don
Copy link
Member

don commented Apr 16, 2020

Fixed by #399. Released in phonegap-nfc 1.1.0. You can get the UID on some tags.

See nfc.scanTag

@don don closed this as completed Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants