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
120 stars 119 forks source link

Include raw payload #54

Closed laurensfischer closed 4 years ago

laurensfischer commented 4 years ago

Hey @semlette ,

thanks for your work and your awesome library. It works like a charm. We need to read NDEFText tags where the first byte as well as the language code was not written correctly. Therefore we need some mechanism to access the raw payload, which we implemented in this pull request. Because we don't think it should be provided by default, we added it as optional parameter to the startReading method. We hope you appreciate our work and approve it to be merged. If not, please tell us what we should improve.

Best regards, Laurens

avbk commented 4 years ago

:+1:

Awesome, I was just looking for this. I also have badly formatted NFC tags. Hope this gets merged soon :slightly_smiling_face:

semlette commented 4 years ago

This seems like a good change. The removal of the first byte stems back to v1, when I didn't even know what it was for - only in v2 did I realise.

Would the dart:typed_data Uint8List be a better data type than String?

Is there a particular reason why this should be controlled by an argument instead of always being set?

laurensfischer commented 4 years ago

Thanks for the input, Uint8List is indeed better. We thought some people won't need the raw payload, but it's probably easier to always provide the raw payload in case someone needs it.

laurensfischer commented 4 years ago

Were you already able to test the changes?

semlette commented 4 years ago

Afraid I don't have time to test it.

Will happily merge and release if you confirm that does indeed work.

@avbk, what do you think of this?

avbk commented 4 years ago

I just tried the branch and it seems to work pretty well :slightly_smiling_face:

semlette commented 4 years ago

Included in v2.0.5.