CoreNFC无法在iOS中读取UID [英] CoreNFC not reading UID in iOS

查看:311
本文介绍了CoreNFC无法在iOS中读取UID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在iOS中使用CoreNFC尝试了一个示例,但是它无法读取制造商的NFC标签的UID,而是期望标签中的消息内容并且只能读取,是否有任何方法可以使CoreNFC读取NFC标签的内容UID?

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?

推荐答案

iOS 13上对CoreNFC的更新意味着您现在可以使用兼容的iPhone读取大多数UID.这样做:请参见 https://stackoverflow.com/a/57993069/3959708

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

可以读取标签的UID,但由于API是私有的,因此无法将其提交到App Store.

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"];
}

此线程有更多信息: https://github.com/hansemannn/iOS11-NFC-Example/issues/16

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

这篇关于CoreNFC无法在iOS中读取UID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆