Search results for

nfc

1,176 results found

Post

Replies

Boosts

Views

Activity

NFC Door Cards with PassKit
Hello, Currently I use typical ID cards to unlock doors in my institution using NFC. I am trying to manipulate the Pass.json file to allow for NFC Door Unlocking. Here is what I think I will be using: {nfc:{message:EXAMPLE,encryptionPublicKey:EXAMPLE}} What I am trying to do is extract the NFC data from my ID card and use it for the NFC message in my Pass.json. If there is any help on how to extract this it would be greatly appreciated. Thanks
1
0
1.8k
Feb ’22
Reply to NFC Door Cards with PassKit
Apple Wallet passes use a proprietary protocol called Value Added Service which is only implemented by specific readers, usually in Point-of-Sale terminals, and very rarely in access control. Additionally, in order to use the nfc key in the pass.json file, you have to receive a special Pass Type ID certificate from Apple.
Feb ’22
Problems Updating a View
Hey everyone! While working on an app which reads the Unique Identifiers of NFC tags I ran into a problem. When I run the code the phone is able to read the tag and add the UID into an array (I checked this by making it print the array whenever the array is updated) but I am unable to make the View update. The reason this is tricky is that when you press a button on the view, it activates the reader function reader.activate() which then updates the array in the Data class only if it successfully extracted the UID. How would I make the View reload every time a new UID is added to the array? Below is the code for the content view, Data class and then the NFC reader. Thanks! View: struct ContentView: View { @StateObject var data = Data() let reader : NFCReader = NFCReader() var body: some View { NavigationView { List { Section( header: Text((data.itemCount) + Items) ) { ForEach(data.products, id: .self) { product in Text(product) } .onDelete(perform: data.deleteItem) .onMove(perform: data.move
6
0
993
Jan ’22
Problems updating a variable
Hey everyone! So I've been creating a program to extract the UID (unique identifier) from an NFC Tag and have been stuck on this very last problem: On the third line I created a variable which I want to be able to change called tagUID, initially just UID. If you look down to the very last line of code, you see that (if there is a connection to the tag) the last thing it's supposed to do is change the state of tagUID to whatever the UID of the tag is, but it's refusing to do so. Everything else works great its only not changing that variable! class NFCReader: NSObject, ObservableObject, NFCTagReaderSessionDelegate { @State var tagUID = UID var session: NFCTagReaderSession? func activate() { self.session = NFCTagReaderSession(pollingOption: .iso14443, delegate: self) self.session?.alertMessage = Hold Your Phone Near the NFC Tag self.session?.begin() } func tagReaderSessionDidBecomeActive(_ session: NFCTagReaderSession) { print(Session Begun!) } func tagReaderSession(_ session: NFCTagReaderSess
3
0
1.2k
Jan ’22
Reply to Problems updating a variable
The problem now, is that when you activate your NFCReader, it does not immediately return the tag... ...so you can not immediately assign reader.tagUID To solve this, in NFCReader we can Publish the tagCode... ...and in the View, we show this published value. Then, when NFCReader gets the tagCode, it will automatically update your SwiftUI View. Try this: import SwiftUI import CoreNFC struct ContentView: View { @StateObject private var reader = NFCReader() var body: some View { VStack{ Text(reader.tagUID) Button { reader.activate() } label: { Text(Scan) .font(.title) }.padding() } } } class NFCReader: NSObject, ObservableObject, NFCTagReaderSessionDelegate { @Published var tagUID = UID var session: NFCTagReaderSession? func activate() { self.session = NFCTagReaderSession(pollingOption: .iso14443, delegate: self) self.session?.alertMessage = Hold Your Phone Near the NFC Tag self.session?.begin() } func tagReaderSessionDidBecomeActive(_ session: NFCTagReaderSession) { print(Session Begun!) } func tagRea
Jan ’22
Updating a variable only after a function stops running
Hey again, I recently asked about updating a variable but now have a new problem. I am creating an NFC reader which when I press scan it prints the UID (Unique Identifier) of the NFC in a text field. When the button labeled Scan is pressed, the function activate() runs which activates the NFC reader and updates a variable within the NFCReader class called tagUID to the UID of the NFC chip. After activate() the button then changes tagCode to equal tagUID. The problem is that I want it to update only after the NFCTagReaderSession ends, as it only updates it to the previous UID scanned right now as it did not finish scanning before I update the variable. How do I do this? The code is below: struct ContentView: View { let reader: NFCReader = NFCReader() @State var tagCode = UID var body: some View { VStack{ Text(tagCode) Button { reader.activate() tagCode = reader.tagUID } label: { Text(Scan) .font(.title) }.padding() } } } struct ContentView_Previews: PreviewProvider { static
2
0
708
Jan ’22
in iOS14,NFC API can not detect tags after restartPolling
I read a typeB card by NFC API.I'll run this method when there's a card reading error: [self.session restartPolling] ; but after that,the delegate tagReaderSession:didDetectTags: will not be called sometimes in iOS14. This is a low probability event that can be reproduced in about 10 or 20 retries. Has anyone had this problem? Is there anyone who can help me solve this problem? Thanks, guys.
1
0
487
Jan ’22
CoreNFC: Sending Custom Commands using NFCISO15693Tag protocol
I'm trying to use iOS 13's new CoreNFC capabilities to readwrite data to an ISO15693 compatible chip. My app includes the NFC Tag Reader Session Formats Entitlements:<key>com.apple.developer.nfc.readersession.formats</key> <array> <string>NDEF</string> <string>TAG</string> </array>The NFCTagReaderSessionDelegate receives an object that conforms the NFCISO15693Tag protocol and I have been successfully called readSingleBlock function to read dtat from the Tag. But whenever I call customCommand to send a proprietary command for reading data from the Tag, I get the following error: Error Domain=NFCError Code=2 Missing required entitlement UserInfo={NSLocalizedDescription=Missing required entitlement}.Does anyone has managed to get this work? What are the missing entitlements needed to use customCommand function?
22
0
8.9k
Jan ’22
NFC ISO15693 custom command: Invalid parameter
Hello,I am currently writing a little prototype using CoreNFC and NFCTagReaderSession with ISO15693 tags.I have a custom command that takes some data as an input and expects to get output data from the tag.I have successfully sent this command to the tag using the app NFC Tools on Android and received the data that I've expected, but fail to get the same response on iOS 13.3.1. All I get is this error:[NFCTagReaderSession transceive:tagUpdate:error:]:735 Error Domain=NFCError Code=102 Stack Error UserInfo={NSLocalizedDescription=Stack Error, NSUnderlyingError=0x282454150 {Error Domain=nfcd Code=10 Invalid Parameter UserInfo={NSLocalizedDescription=Invalid Parameter}}}Why does this command work on Android but not on iOS?The command lies within the range of valid custom commands (0xA0 to 0xDF) for ISO15693 tags.Has anyone experienced similar issues? Maybe someone can share some learnings. I am grateful for every piece of information or any help.Kind regards.
2
0
1.9k
Jan ’22
Reply to Using Wallet.app to open doors with NFC reader
Same problem with me, I have tryed transit “TAP” card, but this card has also dynamic number which changes all the time. I think that all apple wallet transit card have dynamic number… When I hold this transit “TAP” card close to my access door which works on 13.56 mhz NFC cards, keychains, tags…it continues to beep all the time because it chages the code every second or faster. Please can someone explain me why apple dosen’t allow us users to issue virtual NFC card where we can write ten digit number to that card and add logo by our choise and add card name?
Topic: App & System Services SubTopic: Hardware Tags:
Dec ’21