Core NFC

RSS for tag

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

Posts under Core NFC tag

79 Posts

Post

Replies

Boosts

Views

Activity

'NDEF is disallowed' Xcode 16.2
Invalid entitlement for core nfc framework. The sdk version '18.2' and min OS version '14.0' are not compatible for the entitlement 'com.apple.developer.nfc.readersession.formats' because 'NDEF is disallowed'. Anyone knows what is the correct configuration SDK version and minimum iOS deployment target for NFC that has NDEF format?
0
3
986
Jan ’25
Credit card ICC Public Key Certificate retrieval
Hello! I have a requirement to read the ICC Public Key Certificate from an EMV credit card to implement a payment validation flow. Aa far as I understand, I can't use Core NFC for that task since it is not supposed to be used for reading sensitive credit card data and it might be rejected by Apple. I'm trying to use Tap To Pay as it seems to offer some general card details. Since Apple's documentation on this side is pretty limited, I'm struggling to understand what is a PaymentCardReader.Token and how can I create one? Can anyone please help me with setting up Tap to Pay?
2
0
515
Jan ’25
Host Card Emulation session reinitialization
Hello, I've been working recently on an access card type appllication, where due to requirements HCE must be used. I started with examples from the official documentation and was able to achieve correct communication. The HCE is working on newer versions of iOS, there's only one problem: acquiring new intent assertion. Due to the business requirements our users may need to use our application multiple times in short periods of time (below 10 seconds apart). Is there any possibility to shorten the required 15 seconds before acquiring a new intent assertion? I appreciate any suggestions.
1
0
380
Jan ’25
Host Card Emulation session reinitialization
I've been working recently on an access card type appllication, where due to requirements HCE must be used. I started with examples from the official documentation and was able to achieve correct communication. The HCE is working on newer versions of iOS, there's only one problem: acquiring new intent assertion. Due to the business requirements our users may need to use our application multiple times in short periods of time (below 10 seconds apart). Is there any possibility to shorten the required 15 seconds before acquiring a new intent assertion? I appreciate any suggestions.
1
0
427
Jan ’25
Issue with Custom Error Message on invalidate in CoreNFC APDU Tag Reader Session
Hi everyone, I'm working on an NFC-related app using CoreNFC with APDU commands to read and write tags. I’ve encountered an issue when trying to handle the scenario where the user cancels the NFC session. Here’s what’s happening: When a user cancels the NFC session manually (e.g., by tapping "Cancel"), I see an error log indicating tagReaderSession|userCancelled. However, when I explicitly call session.invalidate(errorMessage: "No NFC tag found") in my code to handle a scenario where no tag is detected, the session still shows the error as userCancelled instead of my custom error message. This behavior is confusing both in terms of debugging and for providing feedback to users, as I expect my custom message to appear instead of the generic "user cancelled" message. func tagReaderSessionDidBecomeActive(_ session: NFCTagReaderSession) { // Session becomes active } func tagReaderSession(_ session: NFCTagReaderSession, didDetect tags: [NFCTag]) { // Handle tag detection logic } func tagReaderSession(_ session: NFCTagReaderSession, didInvalidateWithError error: Error) { print("Session invalidated with error: \(error.localizedDescription)") } func handleNoTagDetected(session: NFCTagReaderSession) { session.invalidate(errorMessage: "No NFC tag found") } I call handleNoTagDetected(session:) explicitly when no tag is detected, expecting the custom error message to show. However, the system still shows the cancellation error. Has anyone else experienced this behavior? Is this the intended behavior for CoreNFC, or am I missing something in my implementation? Any guidance would be appreciated. Thanks in advance!
0
0
391
Jan ’25
Regarding licensed applet
To apply for NFC & SE Platform entitlement, I need to provide information regarding licensed applets and TSM. However, I currently lack background knowledge in these areas. Could you provide me with an overview or examples of what licensed applets and TSM entail?
0
0
410
Dec ’24
Read Debit/Credit Card data using NFC
I am trying to find solutions past 4 days. but not getting any reference about NFC implementation in my app to read Debit/Credit card upon user consent? Can you confirm apple is provided any api for read Debit/Credit card using NFC or not. Tried with normal NFCReader but it reads only for normal tags but nothing with Visa/ MasterCard cards. Looking forward some help from you. Thanks
4
1
1.3k
Dec ’24
Step-by-Step Guide Needed for NFC Activation in Apple Wallet Pass
Hi everyone, I am working on creating an NFC-enabled Apple Wallet pass but have been unable to get the NFC functionality to work. While the pass itself adds to Wallet without issues, the NFC feature does not activate. Here’s a summary of what I’ve done: 1. Developer Setup: Registered a Pass Type ID in my Apple Developer account. Generated and installed the Pass Type ID certificate. Installed the latest WWDR certificate. 2. Pass JSON Configuration: My pass.json file includes the following NFC configuration: "nfc": { "message": "Tap to unlock door", "encryptionPublicKey": "MY_ENCRYPTION_PUBLIC_KEY", "payload": "encrypted_nfc_payload" } 3. Testing Results: When the pass includes the nfc field, it adds to Wallet but NFC does not work. If I remove the nfc field, the pass works fine (minus NFC, of course). What I Need Help With: 1. A step-by-step guide for correctly implementing NFC in Wallet passes, including details about encryption, key generation, and any additional setup steps. 2. Information on whether there are specific device or iOS version requirements for NFC-enabled passes. If there are any prerequisites or specific configurations I might be missing, please let me know. I’d really appreciate detailed guidance or resources that could help resolve this issue. Thank you!
1
2
777
Dec ’24
Invalid ISO7816 APDU detected
I'm creating an app using CoreNFC to communicate with a device. Initial communication works as intended, but the last response from the device fails after authentication is finished. When I respond with the last response in my .received(): try await cardAPDU.respond(response: responseAPDU) It goes through, but then .readerDeselected is triggered. Looking in the more detailed errors in console is see the following: -[_NFCardSession validateReceivedAPDU:]:236 Invalid ISO7816 APDU detected, (null) Note: The same behviour works as intended on Android, so the response should be fine from the device.
1
0
420
Dec ’24
-[_NFCardSession validateReceivedAPDU:]:236 Invalid ISO7816 APDU detected
I've started building an app that uses NFC to communicate towards a device. The initial communication is being triggered as intended, the last step of authentication is sent the connection seems to drop with the message: -[_NFCardSession validateReceivedAPDU:]:236 Invalid ISO7816 APDU detected, (null) The same response has been validated on an Android device and the process works fine there, but .readerDeselected is triggered instead of .received with cardAPDU. Any way to see which part of the validation that fails? Best regards
3
0
491
Dec ’24
SSO extension and NFC tag
Hi, We are developing an Enterprise SSO extension for use by our customers. It is working well for username/password. We would like to use external security tokens such as Yubikey, via NFC. This works well inside the container app. However, it looks like NFC might not be available to the SSO extension? The container app is signed with an NFC entitlement, and has the relevant key in the plist for a prompt to show the user. We use a 3rd party package called Yubikit to communicate with the Yubikey in the container app... all good. In the trial I did, I had the SSO appex configured as a Credential extension. I have a demo/sample host app that uses this service, that mirrors what our customer's apps will do. Currently, due to limitations in the server we are connecting to, instead of relying on a 401 authentication challenge, I am "manually" activating the enterprise SSO credential appex using ASAuthorizationSingleSignOnProvider, then our customer's host app will use the token the SSO appex returns for authenticating its API calls. This is working perfectly for the username/password scenario. However some of our customers are very security conscious and require hardware tokens. When I drive the same code in the contained SSO Enterprise app extension, and attempt to activate the NFC reader the same way, it seems like it doesn't have access to NFC? I attempted to add the entitlement to the appex as well but it wasn't even available on the list of entitlements! This leads me to suspect that iOS doesn't allow the SSO appex process to have access to the NFC reader, and there's no way to do what I'm attempting? Note: it is easy for us to move to using a Redirect extension instead if this is the answer, but it doesn't seem that it's likely to help? What is the recommended approach here? Regards, Carl
1
0
363
Dec ’24
NFC card
Hello, I want to set a text as the NFC tag of the current phone, and then read the content of the current tag through NFC sharing or other iPhones. Ask if there is a suitable API, or interface.
1
1
481
Dec ’24
NFC & SE Platform API Details
On the post of NFC & SE Platform for secure contactless transactions, the API details are clearly mentioned. Will the same core NFC APIs be used here or we will get to know the new APIs of NFC & SE Platform only after entering into agreement with apple? Any documentation of APIs of NFC & SE Platform will be helpful.
1
0
777
Nov ’24
Problem with reading NFC tag in background in not working with NFC ISO 14443-3A
Hi folks, I have trouble with reading NFC tag in background while my application is running. I still receives a message in my iPhone 13, NFC tag of web Open "donator.cz" in application Safari. But I would like to open the app Donator which is here: https://apps.apple.com/dk/app/don%C3%A1tor/id6473955033 My NFC chip scanned by "NFC Tools" is ISO 14443-3A (NXP-NTAG213) In the tag is mentioned https://donator.cz/<8digits-number>**text In my Info.plist of application is: <key>LSApplicationQueriesSchemes</key> <array> <string>https://donator.cz</string> </array> <key>com.apple.developer.nfc.readersession.felica.systemcodes</key> <array> <string>12FC</string> </array> <key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key> <array> <string>D2760000850101</string> </array> Apple CDN looks like: https://app-site-association.cdn-apple.com/a/v1/donator.cz I have read in Apple documentation https://developer.apple.com/documentation/corenfc/adding-support-for-background-tag-reading that application should be in progress A Core NFC reader session is in progress. How to do it in AppDelegate or SceneDelegate. One note is that everything works properly in case of reading NFC based on button click is pressed. My NFCHandler looks like: // // NFCReader.swift // Donator // // Created by Petr Hracek on 22.11.2024. // import Foundation import UIKit import CoreNFC class NFCHandler: NSObject, NFCNDEFReaderSessionDelegate { var readerSession: NFCNDEFReaderSession? func startBackgroundScanning() { guard NFCNDEFReaderSession.readingAvailable else { return } readerSession = NFCNDEFReaderSession(delegate: self, queue: DispatchQueue.main, invalidateAfterFirstRead: true) readerSession?.alertMessage = "Prilozte NFC tag" readerSession?.begin() } func readTag(session: NFCNDEFReaderSession , tags: [NFCNDEFTag] ) { if tags.count > 1 { // Restart polling in 500ms let retryInterval = DispatchTimeInterval.milliseconds(500) session.alertMessage = "More than 1 tag is detected, please remove all tags and try again." DispatchQueue.global().asyncAfter(deadline: .now() + retryInterval, execute: { session.restartPolling() }) return } // Connect to the found tag and perform NDEF message reading let tag = tags.first! session.connect(to: tag, completionHandler: { (error: Error?) in if nil != error { session.alertMessage = "Unable to connect to tag." session.invalidate() return } tag.queryNDEFStatus(completionHandler: { (ndefStatus: NFCNDEFStatus, capacity: Int, error: Error?) in if .notSupported == ndefStatus { session.alertMessage = "Tag is not NDEF compliant" session.invalidate() return } else if nil != error { session.alertMessage = "Unable to query NDEF status of tag" session.invalidate() return } tag.readNDEF(completionHandler: { (message: NFCNDEFMessage?, error: Error?) in var statusMessage: String if nil != error || nil == message { statusMessage = "Fail to read NDEF from tag" } else { statusMessage = "Found 1 NDEF message" DispatchQueue.main.async { // Process detected NFCNDEFMessage objects. debugPrint(message!) //self.tableView.reloadData() } } session.alertMessage = statusMessage session.invalidate() }) }) }) } /// - Tag: sessionBecomeActive /// This method will called when NFC session become active /// Tells the delegate that the session detected NFC tags with NDEF messages. func readerSessionDidBecomeActive(_ session: NFCNDEFReaderSession) { debugPrint("NFC session become active======") } func readerSessionDidInvalidate(_ session: NFCNDEFReaderSession) { debugPrint("NFC session invalidate======") } func readerSession(_ session: NFCNDEFReaderSession, didInvalidateWithError error: Error) { print(error) } func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) { for message in messages { for record in message.records { print("Type name format: \(record.typeNameFormat)") print("Payload: \(record.payload)") print("Type: \(record.type)") print("Identifier: \(record.identifier)") } } } /// - Tag: processingNDEFTag /// if This method is not implement then only func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) will call /// Tells the delegate that the session detected NFC tags with NDEF messages and enables read-write capability for the session. func readerSession(_ session: NFCNDEFReaderSession, didDetect tags: [NFCNDEFTag]) { self.readTag(session: session, tags: tags) } }
1
0
603
Nov ’24
Tap to Pay implementation to use debit and credit card for payments
I am trying to implement Tap-To-Pay in my app. I want to use this feature to be able to read my debit card details and pass it to my payment processor SDK Cybersource to securely do the payment. I tried following this documentation https://developer.apple.com/tap-to-pay/#regions I want to know if this implementation is possible or not? If it is possible can you guide me the process on how to read card data? Thanks
1
0
503
Nov ’24
iOS HCE - Select PPSE
Hi, for https://developer.apple.com/documentation/corenfc/cardsession/, is the Select PPSE APDU forwarded to the 3rd party payment app for processing? The use case is to provide a specific list of AIDs controlled by the app rather than all the AIDs registered under the app's entitlement.
2
0
635
Oct ’24