capawesome-team / capacitor-nfc

⚡️ Capacitor plugin for reading and writing NFC tags.
https://capawesome.io/plugins/nfc/
MIT License
74 stars 14 forks source link

feat: Ndef Format with optional NdefRecord provided #28

Closed easpinall closed 1 year ago

easpinall commented 1 year ago

Is your feature request related to a problem? Please describe:

In practice when a user needs to load data onto the NFC tag and its not yet NdefFormatted you currently need to format it first and then do a second read (nfcTagScanned) event to be able to write the initial data that was intended since you can't currently format and write in the same event process.

Describe the solution you'd like:

Currently when the tag is formatted for Ndef its writing a blank Ndef record to the tag. If the Nfc.format() command could take a optional NdefRecord as a parameter it would allow for the initial data to be written in the same event process as the formatting process.

Describe alternatives you've considered:

Double tapping the tag but this isn't user friendly for the end user or alternatively allow for a write() after the format() command, currently this gives an error stating that the NFC tag isn't Ndef formatted yet

Additional context:

Screenshot 2023-08-18 160236

robingenz commented 1 year ago

@easpinall Thank you for your request. Sorry for my late response. I am currently on vacation. It should already be possible to do this in „one step“, see https://github.com/capawesome-team/capacitor-nfc/discussions/17#discussioncomment-6061724

easpinall commented 1 year ago

Thanks, we have tried that and getting the same problem as @meisterm which is also depicted in the screen shot attached above.

robingenz commented 1 year ago

I will check this and get back to you.

robingenz commented 1 year ago

I just posted a comment to the discussion: https://github.com/capawesome-team/capacitor-nfc/discussions/17#discussioncomment-7326561 I close this issue as duplicate of https://github.com/capawesome-team/capacitor-nfc/discussions/17

We will continue there so I don't have to repost everything.