Core NFC

RSS for tag

Detect NFC tags, read messages that contain NDEF data, and save data to writable tags using Core NFC.

Core NFC Documentation

Posts under Core NFC tag

59 Posts
Sort by:
Post not yet marked as solved
0 Replies
502 Views
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
Posted
by Talkwondo.
Last updated
.
Post not yet marked as solved
1 Replies
1.3k Views
Why is there no public APIs for developers (PassKit) to implement Apple Wallet NFC for employee badges as announced in WWDC 2021 Keynote? Can a simple Apple platforms developer implement this for the organization they are working on and don't have to go to third-party providers which seem to have this capability? Seems that I need to reach out to the below companies to enable this in the current organization I'm working with: third party providers: https://swiftconnect.io/owners/ https://www.hidglobal.com/solutions/access-control/hid-mobile-access-solutions
Posted Last updated
.
Post not yet marked as solved
0 Replies
613 Views
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!
Posted Last updated
.
Post not yet marked as solved
0 Replies
542 Views
We are using an NFC tag that complies with ISO14443A and B standards (ISO-DEP) and supports ISO/IEC 7816 security. We are attempting to write some data using CoreNFC's NFCNDEFReaderSessionDelegate. We can detect the tag, but when we try to connect to it, it displays NFC Error (Tag Connection Lost). We also attempted NFCTagReaderSessionDelegate, but we were unable to detect the tag at that moment. Note that we have included the Privacy - NFC Reader Usage Description and ISO7816 application IDs for NFC Tag Reader Session to info.plist. Tag Reader Session Formats for Near Field Communication in entitlements.plist Can you advise on whether the problem is caused by the tag we're using? Or the CoreNFC library does not support writing? Thank you for your valuable time and assistance
Posted Last updated
.
Post not yet marked as solved
0 Replies
633 Views
Hello All, I am using the sample code provided in this website https://developer.apple.com/documentation/corenfc/building_an_nfc_tag-reader_app I modified the MessagesTableViewController file to read and authenticate the Ntag213 tag. Since the Ntag213 is compatible with Mifare Commands. I used that in my code. I have attached the code below. import UIKit import CoreNFC /// - Tag: MessagesTableViewController class MessagesTableViewController: UITableViewController, NFCNDEFReaderSessionDelegate { // MARK: - Properties let reuseIdentifier = "reuseIdentifier" var detectedMessages = [NFCNDEFMessage]() var session: NFCNDEFReaderSession? // MARK: - Actions /// - Tag: beginScanning @IBAction func beginScanning(_ sender: Any) { guard NFCNDEFReaderSession.readingAvailable else { let alertController = UIAlertController( title: "Scanning Not Supported", message: "This device doesn't support tag scanning.", preferredStyle: .alert ) alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) self.present(alertController, animated: true, completion: nil) return } session = NFCNDEFReaderSession(delegate: self, queue: nil, invalidateAfterFirstRead: false) session?.alertMessage = "Hold your iPhone near the item to learn more about it." session?.begin() } // MARK: - NFCNDEFReaderSessionDelegate /// - Tag: processingTagData func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) { DispatchQueue.main.async { // Process detected NFCNDEFMessage objects. self.detectedMessages.append(contentsOf: messages) self.tableView.reloadData() } } func addMessage(fromUserActivity ndefMessage: NFCNDEFMessage) { // Add the message to the list of detected messages detectedMessages.append(ndefMessage) // Reload the table view tableView.reloadData() } func readerSession(_ session: NFCNDEFReaderSession, didDetect tags: [NFCNDEFTag]) { guard let tag = tags.first else { return } session.connect(to: tag) { error in if let error = error { // Handle connection error print(error.localizedDescription) session.invalidate() return } if let miFareTag = tag as? NFCMiFareTag { // Get the password and PACK values from base64 let pwdBytes = Data(base64Encoded: "ABCDEFG")! let packBytes = Data(base64Encoded: "XYZ")! // Authenticate the tag let authenticationCommand = Data([0x1B] + pwdBytes.map { $0 as UInt8 }) miFareTag.sendMiFareCommand(commandPacket: authenticationCommand) { response, error in if let error = error { // Authentication failed print("The tag is not authenticated") session.invalidate() return } // Authentication succeeded // Continue with further operations if response == packBytes { print("The tag is authenticated") } else { print("The tag is not authenticated") } } } else { // Handle unsupported tag type session.invalidate() } } } func readerSession(_ session: NFCNDEFReaderSession, didInvalidateWithError error: Error) { // Check the invalidation reason from the returned error. if let readerError = error as? NFCReaderError { // Show an alert when the invalidation reason is not because of a // successful read during a single-tag read session, or because the // user canceled a multiple-tag read session from the UI or // programmatically using the invalidate method call. if (readerError.code != .readerSessionInvalidationErrorFirstNDEFTagRead) && (readerError.code != .readerSessionInvalidationErrorUserCanceled) { let alertController = UIAlertController( title: "Session Invalidated", message: error.localizedDescription, preferredStyle: .alert ) alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) DispatchQueue.main.async { }}}}}
Posted
by varundmf.
Last updated
.
Post not yet marked as solved
0 Replies
390 Views
Good day everyone, We have an app containing App Clip which should appear after scanning an URL from an NFC tag. Now if the tag contains ONLY one NDEF URL Record, the App Clip appears. But if there are more fields (as in our case), while URL record being still the first. App Clip is not started, iOS tries to open URL in safari. Is there might be official statement from Apple on this? Could not find any reference in the docs.
Posted Last updated
.
Post not yet marked as solved
2 Replies
1k Views
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 -> [] } } } }
Posted Last updated
.
Post not yet marked as solved
2 Replies
802 Views
We have several issues enabling our app for Assistive Access: We use Critical Alerts. There seems to be no way to set this up unless we set up the app in "normal" mode first. If we run our app in AA first and then go back to normal the Notification settings page is blank. Notifications show up as saying "New". I am guessing this is a beta issue? We cannot use NFC (no connect sheet is displayed when we try.) We MUST have NFC to connect to our medical device (as well as BlueTooth). These are show stopper issues for our app.
Posted
by jshulman.
Last updated
.
Post not yet marked as solved
34 Replies
35k Views
After updating to iOS 15.4 I can no longer read any NFC tags. I believe Apple Pay is working fine. Replication: Unlock iPhone, hold NFC tag to top back of phone (without case or other magnetic or metallic materials nearby). Default iOS behaviour should be to read the contents of a known working tag (works perfectly on an Android device) and display a popup to manage the tag information (e.g. Popup would ask permission to open Safari to open a web link programmed on a tag) 3rd Party Tools: Previous versions of iOS 15 beta allowed read and write of NFC tags using apps such as NFC and NFC Tools. I have used "normal" mode, compatibility mode, have attempted to (re)format the tag to no avail. When conducting a read or write using these tools a popup appears, but no tag can be read or written. "Ready to Scan" popup remains open. Further steps taken: Hard Reset: No effect
Posted Last updated
.
Post not yet marked as solved
0 Replies
1k Views
background nfc isn't working in 16.5... on iphone 11 able to scan nfc using apps and through shortcuts app (when initially scanning) however background nfc is not working at all has anyone else experienced this problem?
Posted
by sfwef.
Last updated
.
Post not yet marked as solved
0 Replies
615 Views
Invalid entitlement for core nfc framework. The sdk version '16.4' and min OS version '11.0' are not compatible for the entitlement 'com.apple.developer.nfc.readersession.formats' because 'NDEF is missing in the entitlement'. (ID: 5825b68c-1bc8-450e-acfa-37f629843796)
Posted
by tevfikcan.
Last updated
.
Post not yet marked as solved
0 Replies
418 Views
Is there a standard for determining the tag type with CoreNFC?
Posted Last updated
.
Post not yet marked as solved
0 Replies
386 Views
Hello everyone, this is my first post. I have a question, I understand that it is possible to generate nfc passes and add them to the apple wallet after obtaining the Apple certificate. Apple asks which physical reader is compatible for reading the pass, but is it possible to use an Android or iOS mobile application to read the pass ? Have a nice day. Kind regards,
Posted
by Huxx.
Last updated
.
Post not yet marked as solved
1 Replies
579 Views
Hi. I'm looking to implement "Access Control Cards" in the apple wallet , that when attached to a supported reader, will open the door. I know that VAS (Value added services) protocol is not intended for that, and there is a new protocol called "Apple Access". Anyone knows where I can find the full documentation about this protocol and what are the Apple requirements to distribute and manage those passes. Anyone can refer me to company that has readers (hopefully with 26bit wiegand - so I can connect it to my controller) that support this Apple Access protocol?
Posted
by AmitS.
Last updated
.
Post not yet marked as solved
0 Replies
609 Views
Hi, I am using the below code to detect if NFC is enabled or not. (BOOL)isNFCAvailable { if ([NFCNDEFReaderSession readingAvailable]) { return YES; } return NO; } I have also added the permission is info.plist file NFCReaderUsageDescription Detecting if NFC is enabled or not I am testing on iphone XS with ios 15.6.1 and on iphone 11 with ios 13.2.2. In both the cases, the API is returning false. Can you please let me know if I am missing something.
Posted Last updated
.