CoreNFC not reading UID in iOS

巧了我就是萌 提交于 2019-11-26 23:40:08

问题


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?


回答1:


Edit: Updates to CoreNFC on iOS 13 mean you can now read most UIDs with compatible iPhones. To do so: see https://stackoverflow.com/a/57993069/3959708

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



来源:https://stackoverflow.com/questions/51822226/corenfc-not-reading-uid-in-ios

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!