Re: [web-nfc] Handling non-formatted tags (#367)

A major difference between the Android NFC API and the Web NFC API is that there is not a separate "card detected" event. This means that the _only_ way that a site can detect that a card is present is by attempting to read or write to it.

It is reasonable for a site to not want to unilaterally change the contents of every card it comes in contact with. The problem with the current policy is that it doesn't allow a site to detect that an unformatted card has been presented and so it _has_ to start with a write operation in order to be able to handle any card, or present the user with a "Did nothing happen? Press this button to format the card first." option.

Potential solutions include,
1. Specifying an event that is fired when an unformatted is presented while scanning.
2. Adding an option to push() that allows a site to detect when there is already data on a card (in any format?) and prevent overwriting it.

-- 
GitHub Notification of comment by reillyeon
Please view or discuss this issue at https://github.com/w3c/web-nfc/issues/367#issuecomment-540683474 using your GitHub account

Received on Thursday, 10 October 2019 17:12:02 UTC