Hi - using code that is out there I have managed to create a skeleton app that will read in a NFC tag on the iPhone 7+ and display the details in the debugger using this code:
func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) {
print("New NFC Tag detected:")
for message in messages {
for record in message.records {
print("Type name: \(record.typeNameFormat)")
print("Payload size: \(record.payload)")
print("Type size: \(record.type)")
print("Identifier: \(record.identifier)")
}
}
Very happy with that!
The data is correct, but I want to print the payload data and cant figure out how to get to it and the documentation seems non existent. Looking around the groups most examples seem to go as far as the above in terms of the size of the payload rather than the value.
I found nfcndefpayload
https://developer.apple.com/documentation/corenfc/nfcndefpayload
Any help of a code example to kick start me as a newbie Swift developer that would be very helpful.