semlette / nfc_in_flutter

Cross-platform flutter plugin for reading and writing NFC tags. Not maintained anymore - not looking for new maintainer, fork instead.
MIT License
119 stars 119 forks source link

writeNDEF using 'rawPayload' writes wrong binary data to the NFC tag #66

Open ishwaryamamidi opened 3 years ago

ishwaryamamidi commented 3 years ago

I'm using this plugin to read and write Ndef records from NFC tag. I'm reading the records using 'rawPayload', it works fine. But when I want to write back to the tag with List which are list of integers it writes some junk value. Can anyone help me resolve this?

ishwaryamamidi commented 3 years ago

Just to be more precise: I am reading records with format "External", a custom type and binary payload (from a specific device), and I need to remove some of these records from the records list and update the tag with this new filtered records list, not modifying the payload of the records that I want to keep on the tag, the problem is that when I call the NdefWrite method it rewrites the tag with changes on the binary payload of these records that I never touched, and this is a problem. I suspect that the problem is caused by the wrong interpretation of the payload by the NDEF constructor, Is there any way of telling the library that that record has a raw payload and that it must be written exactly as it was read?