nfc_in_flutter icon indicating copy to clipboard operation
nfc_in_flutter copied to clipboard

Is there any way to NDEF format NFC tag?

Open aventez opened this issue 3 years ago • 2 comments

My question is how can I NDEF format the empty NFC tag in Flutter? Currently, I'm using this lib, but it only supports already NDEF formatted tags. Any ideas how to solve that?

Here is my code.

NDEFMessage newMessage = NDEFMessage.withRecords([
  NDEFRecord.uri(path),
]);

Stream<NDEFTag> stream = NFC.writeNDEF(newMessage, once: true);
stream.listen((NDEFTag tag) {
  showNotification(context, 'NFC Tag was activated.');
});

Thanks in advance!

aventez avatar Mar 21 '21 01:03 aventez

@aventez I don't believe the function to format a tag to NDEF exists in the code. Would need to be developed as an option.

ZippyRainbow avatar Apr 17 '21 06:04 ZippyRainbow

I think at least for android the necessary code is there. See https://github.com/semlette/nfc_in_flutter/issues/84 for more information. No idea if it works. I do not know how to format a tag differently for testing 😄 But new Tags are working for me on Android but not on iOS, so probably it's working.

https://github.com/semlette/nfc_in_flutter/blob/8c0550e32d19af82dc482ece65ddb83808003ea4/android/src/main/java/me/andisemler/nfc_in_flutter/NfcInFlutterPlugin.java#L628-L642

guenth39 avatar May 20 '21 12:05 guenth39