It's my first time posting here so I don't really know what to do. I'm fairly new to iOS development and I have project that I need to make that uses NFC (CoreNFC). As I encountered errors in my code, I realized I needed to add the NFC capability however it's not showing in the capabilities list. After a bit of research, I found someone saying I needed to have an Apple Developer account (for 99$) to unlock this feature. Is this true? If not, what can I do to add the Near Field Communication Tag Reading capability to my project?
Core NFC
RSS for tagDetect NFC tags, read messages that contain NDEF data, and save data to writable tags using Core NFC.
Posts under Core NFC tag
65 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Hello, I have ICode Slix and Slix 2 NFC tags. I'm working on an iOS app for reading and writing data to these tags. I've tried various approaches, but I'm having trouble with the writing part. Could you please assist me in understanding how to write encode URL in that tags Here's my current code
Because these tag is not bydefault NDEF format and I want to right url in that tag and make it NDEF formattable.
I tried to write data with NFC Tool application it can write data easily in that but my code doesn't work.
how to right data in NFC forum type 5 tags?
func tagReaderSession(_ session: NFCTagReaderSession, didDetect tags: [NFCTag]) {
print("Connecting To Tag")
if tags.count > 1 {
session.alertMessage = "More Than One Tag Detected, Please try again"
session.invalidate()
return
}
let tag = tags.first!
session.connect(to: tag) { error in
if let error = error {
session.invalidate(errorMessage: "Connection Failed: \(error.localizedDescription)")
return
}
if case let .iso15693(sTag) = tag {
let textToWrite = "hello"
if let textData = textToWrite.data(using: .utf8) {
sTag.writeSingleBlock(requestFlags: [.highDataRate], blockNumber: 0x05, dataBlock: textData) { error in
if let error = error {
print("Error writing to NFC tag: \(error.localizedDescription)")
} else {
print("Data successfully written to NFC tag.")
}
session.invalidate()
}
} else {
print("Error encoding text to data")
session.invalidate()
}
}
}
}
I am trying to transfer data from one device to another using NFC. I'm trying to figure out if this is possible, I downloaded apple's sample project about CoreNFC, I was able to read NFC Tags (it wasn't a real NFC Tag, rather it was an NFC Tag emulated with an android device). Can I use my iPhone to emulate an NFC Tag to transfer data to another iPhone or Android device?
I bought RFID card: NFC 13.56MHz ISO14443A but Iphone can`t read it. What types of RFID card Iphone can read. Is there any specifictaion what cards Iphone can read?
Hi,
I was using NFCNDEFReaderSessionDelegate at first to read and write the cards, but didDetect tags method did not detect any tag because my nfc tag is not pre-formatted, it was calling other delegate methods so I have my NFCNDEFReaderSessionDelegate setup correctly. Hence, I used NFCTagReaderSessionDelegate, didDetect tags method of NFCTagReaderSessionDelegate detected tag and the tag was not pre-formatted. The issue I have been facing is I am not able to write for the first time and getting an error
Error Domain=NFCError Code=102 "Tag Not NDEF formatted" UserInfo={NSLocalizedDescription=Tag Not NDEF formatted}.
When I used another app from apple store to write data on the same tag which is not pre-formatted. Using that app, I am able to write the data on that tag. That app was using CoreNFC framework I believe, as it has NFC session alert which seems it was from apple library CoreNFC, so I assume that there must be a way to write the data on unformatted nfc tags. Do I have to use any low level of commands? I am not sure how can I fix this issue. Please provide some sample code, suggestions, right path to make the tag ready to have NDEF format and able to write the data on it.
Here is my NFC tag details:
we are using the STMicroelectronics/STNFCSensor tag, the tag configuration is
Block Size: 4
Memory size in blocks: 2048
memory size in bytes: 8192
tag type: iso15693
Below i added my code
func readSingleBlock(to tag: NFCTag, blockNumber: Int, completion: @escaping (Data) -> Void) {
bfprint("NFC_Tag enter extendedReadSingleBlock blockNumber: \(blockNumber)")
if case let .iso15693(tagIso15693) = tag {
tagIso15693.extendedReadSingleBlock(requestFlags: [.highDataRate], blockNumber: blockNumber) { result in
bfprint("NFC_Tag extendedReadSingleBlock \(result)")
switch result {
case .success(let data):
self.retryAttempt = 0
bfprint("NFC_Tag Success tag response:", "\(data), ")
completion(data)
case .failure(let error):
if self.retryAttempt > 5 {
bfprint("NFC_Tag failure: \(error) \(error.localizedDescription) ")
self.session?.invalidate(errorMessage: error.localizedDescription)
} else {
self.retryAttempt += 1
bfprint("NFC_Tag failure retryAttempt: \(self.retryAttempt) ")
self.retryConnection()
}
}
}
}
}
func retryConnection() {
guard let session,
let tag = self.tag else { return }
session.connect(to: tag) { [weak self] (error) in
if let error = error {
print("Retry connection error: \(error.localizedDescription)")
self?.session?.invalidate(errorMessage: "Retry connection error: \(error.localizedDescription)")
return
}
self?.readNfcTag(tag: tag)
}
}
extendedReadSingleBlock function giving error "NFCError Code=100 “Tag connection lost”
I am aware of NFC and UWB api which I have already gone through the official document page. We have to create CCC based digital keys so we are going to use UWB, NFC technologies. So Is there any CCC based UWB,NFC api available for development? We are members of the CCC organization. Could you please support us for this.
We have to create CCC based digital keys so we are going to use UWB, NFC technologies. So Is there any CCC based UWB,NFC api available for development? We are members of the CCC organization. Could you please support us for this
I have gone through UWB NFC document from official apple website.But I want to get idea on CCC based NFC and UWBs.
my app store application have met this problem most at OS version 16.6 and other OS version when i use [NFCReaderSession featureAvailable:],and Near Field Communication capability is equiped。I have no idea why this would happen。
I want to read EMV protocol its possible today with IOS 16 ?
its possible to use SELECT or others commands in APDU CoreNFC ?
Its possible to interact with 2PAY.SYS.DDF01 ?
IPhone 14 Pro - ios 17 Beta
NFC tag reader no longer functioning as of ios15 update. I have updated to Beta 17 and still not working. Airfrop off, cellular data off and have completed several restarts.
Any help with repairing is appreciated.
Thank you.
Hey,
I don't know why i can not make scan function work.
I have written in the entitlement file:
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
<string>NDEF</string>
<string>TAG</string>
</array>
</dict>
</plist>
also in the info.plist:
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>A0000002471001</string>
<string>D2760000850101</string>
<!-- Add more AIDs as needed -->
</array>
still get the error Error Domain=NFCError Code=2 "Missing required entitlement"
of course when i remove the iso18092 enum everything is working.
Help? thanks
Hello!
Thank you very much for your WWDC NFC sessions! I really like the format and the information you provided in those session :)
I have a question regarding my app that I am planning to develop using an NFC technology. I tried to find a necessary information in WWDC sessions and documentations but I couldn't find anything that might be helpful for me.
The idea is simple. I want to use my app as the proxy between user's payments cards (debit or credit) and the payment terminal. The logic is something like this:
User taps an iPhone to a payment terminal (just like in the Wallet) and my app reads the data from the payment terminal through NFC (merchant name, merchant category, amount to be paid, etc.)
My app receives this information, does some formatting and other operations
My app sends the user's card information to the NFC (a card information is received and stored in my app through some 3rd party service, like Plaid)
Payment terminal receives this information and shows either the payment succeed or failed.
I am wondering is it possible to achieve this using the current API of NFC framework? While I am aware that the NFC framework supports the ISO-7816 standard, based on my research so far, it seems there is no way to achieve this functionality.
Correct me if I am wrong.
Thanks!
I am implementing iOS APP with to read NFC tag with these mentioned technologies NfcA, MifareClassic, NdefFormatable so is there a way that I can access these types of tags.
Can I access MifareClassic tags with iOS using coreNFC ?
I am implementing the NFC feature from the iOS side and wanted to know that can we read the data from mentioned technologies here NfcA, MifareClassic, and NdefFormatable.
can we implement NFC using core NFC that can read the data from MifareClassic tags?
I am developing an iOS app in which the device(iPhone) needs to act as an NFC tag using Felica so that an NFC reader could read the information present in this virtual tag (like person details). Currently Suica and Pasmo is being used for contact less payment but we ant to use the same technique but for our IOS app. Is it possible to achieve this ?
Hi there,
I am using Core NFC and I established the connection with the card, (it means that the info.plist is correct and the entitlement should be correct as well). The app detects the card, but after sending the command 'tag.sendCommand()' I receive this message:
[CoreNFC] -[NFCTagReaderSession transceive:tagUpdate:error:]:879 Error Domain=NFCError Code=2 "Missing required entitlement" UserInfo={NSLocalizedDescription=Missing required entitlement}
So, what is missing or what am I doing wrong?
Here is the code:
func tagReaderSession(_ session: NFCTagReaderSession, didDetect tags: [NFCTag]) {
guard !tags.isEmpty else { return }
let hexString = //...
if case let .iso7816(tag) = tags[0] {
session.connect(to: tags[0]) { error in
if let error = error {
print("Error: \(error.localizedDescription)")
return
}
let apdu = hexString.convertToAPDU()
tag.sendCommand(apdu: apdu) { (response: Data, sw1: UInt8, sw2: UInt8, error: Error?) in
// -> here is when the error appears, in the completion
print([UInt8](response)) // print -> []
}
}
}
}
Hi, I'm developing an app that reads the NFC tags. So far so good, everything worked as expected, the app reads the passports and the IDs, until we encountered the french ID issued after March 2021. My app has the following entitlements:
<dict>
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
<string>TAG</string>
</array>
</dict>
And this additional entries in the .plist:
<key>NFCReaderUsageDescription</key>
<string>NFC usage to scan ID chip</string>
...
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>A0000002471001</string>
<string>A0000002472001</string>
<string>00000000000000</string>
</array>
According to an article which I cannot link on this forum because the domain is not permitted, iOS started supporting this specific ID from version 16. When I look at the docs, I can see the .pace polling mode was added. I tried specifying this additional polling mode in my app like so:
var pollingOptions: NFCTagReaderSession.PollingOption = [.iso14443]
if #available(iOS 16, *) {
pollingOptions.insert(.pace)
}
self.session = NFCTagReaderSession(pollingOption: pollingOptions, delegate: self, queue: nil)
But when I try to start the session it gets instantly invalidated with this message: Missing required entitlement. I'm pretty confident the message is misleading and something else is missing somewhere, my bet would be on the .plist entry com.apple.developer.nfc.readersession.iso7816.select-identifiers missing one of the cryptic numbers, but I have no idea where this can be taken from.
How do I implement this .pace polling mode, can someone give me some guidance?
Hi everyone,
I work in a company with NFC-enabled reader manufacture. As for the title, I have searched for it for a lone time. Not NFC Certificate Request, it's for issuing passes. I inquired about MFI and the reply was that NFC is not within the scope of MFI. I have asked the local Apple team for help and they have no contact information for other teams and it is not clear which team to contact. My questions are below.
Where is the correct and official contact window for Apple VAS?
Is my post posted in the correct forum? If not, can you provide the correct place to ask?
If possible, I hope to know the conditions for obtaining VAS authorization.
Thanks a lot.
Ken.
Hello everyone,
I purchased a level lock touch earlier this year. It’s a lock I have on my front door and side door. One of the ways it can be unlocked is with an NFC card. You can tap the card and the lock opens.
Since the apple devices have NFC, and so does the level lock touch, I figured there must be a way to just unlock the door by tapping my devices. I asked apple about this and they said they couldn’t help me. I reached out to Level and they said apple will be selling a new level lock + which on October 21st which does exactly what I’m wanting to do….for $329!
my question is, if both devices have NFC- couldn’t there just be some type of software update to allow this feature to happen. Instead- someone has to purchase a whole new lock!? I know it’s all about money but it just doesn’t make sense to me.
does anyone maybe know of a third party app that can read the level lock nfc card and allow me to open the lock by tapping my device? In the mean time I’ll keep looking for another way besides shelling out another 329 for a lock. Smh