semlette / nfc_in_flutter

Cross-platform flutter plugin for reading and writing NFC tags. Not maintained anymore - not looking for new maintainer, fork instead.
MIT License
120 stars 119 forks source link

No tag id being displayed #35

Open lindsay-twoblacksheep opened 4 years ago

lindsay-twoblacksheep commented 4 years ago

Hi I'm using version 2.0.2 and I am able to read my tag, however I am trying to read the serial number/id but it get returned as an empty string.

Any idea what could be wrong?

semlette commented 4 years ago

Is this on Android or iOS? Also could you tell more about the tags you're using?

James-A-White commented 4 years ago

I'm having the same issue. I'm using an NTAG213, Tag type: ISO 14443-4, running on the latest version of iOS. When I run NFC Tools on the same phone and the same NFC tag, it gives me the serial number. I'd love to be able to read that serial number using NFC_in_flutter. Thanks!

I'm using the 2.0.4 version.

the-white-cat commented 4 years ago

Same issue there with NTAG213 ISO 14443-3A, iOS - no id provided, NFC Tools displays it correctly. Android seems working fine

Sreadon commented 4 years ago

Hi, same on my side with NTAG215. On Android it's perfect I can retrieve the tag's ID even if not NDEF formatted but on iOs the retrieved tag's ID is null.

Any ideas of how I could implement something to retrieve the tag's ID on iOs? I don't need to read / write data on the tag, just to read the tag's ID :) Tested on an iPhone 2020 SE.

the-white-cat commented 4 years ago

@Sreadon yep, we had to write custom approach for iOS using NFCTagReaderSession. However, author mentioned "tags" branch in a different discussion, but it didn't work for us:(

Sreadon commented 4 years ago

Does your custom solution with NFCTagReaderSession works? May I ask an help on how to implement this if it's the case? I'm a total noob on iOs code.

the-white-cat commented 4 years ago

It works for us. The solution is to cast the tag to MiFare tag which contains id data Its quite simple, here's the link: https://developer.apple.com/documentation/corenfc/nfcmifaretag

But again, we work with mifare only

Sreadon commented 4 years ago

Thanks, I'll give it a try.