CoreNFC not reading UID in iOS
Asked Answered
S

1

3

I have tried a sample with CoreNFC in iOS, but it fails to read the manufacturer's UID of the NFC Tag, instead it expects message content from the Tag and reads only that, Is there any way to make CoreNFC read the NFC Tag's UID?

Shishko answered 13/8, 2018 at 12:19 Comment(1)
CoreNFC only reads the content of an NDEF tagPossing
U
3

Edit: Updates to CoreNFC on iOS 13 mean you can now read most UIDs with compatible iPhones. To do so: see https://mcmap.net/q/1195172/-reading-uids-of-nfc-cards-in-ios-13

It is possible to read the UID of a tag, but it will not be able to be submitted to the App Store because the API is private.

 - (void) readerSession:(nonnull NFCNDEFReaderSession *)session didDetectNDEFs:(nonnull NSArray<NFCNDEFMessage *> *)messages {

  NSArray *foundTags = [session valueForKey:@"_foundTags"];
  NSObject *tag = foundTags[0];
  NSData *uid = [tag valueForKey:@"_tagID"];
}

This thread has more info: https://github.com/hansemannn/iOS11-NFC-Example/issues/16

Upandcoming answered 13/8, 2018 at 14:16 Comment(2)
So, you're reading the UID inside readerSession funcion, but in my case, as the NFC Tag doesn't have any message content, it is not getting detected!, I'm trying to read the Chip Serial Number(CSN or UID)Shishko
As you know, CoreNFC does not detect tags which do not contain NDEF formatted data. You could consider using a peripheral reader. See: flomio.com/shop/readers/floble-plus-nfc-reader Disclosure: I work for FlomioUpandcoming

© 2022 - 2024 — McMap. All rights reserved.