Re: [web-nfc] NDEF Read triggered when writting an NDEF (#551)

@OlivierGrenoble thank you for giving the real usage feedback for the WebNFC API. We'd like to hear sound like this. 
I did some tests based on your info and understand your request. You want to write the tag only, without a following Activity Chooser showing. 
Actually, I saw this notice before on the old version API occasionally and from the code perspection, WebNFC implementation in Chromium can do nothing to prevent this because it is an OS action. See these:
https://developer.android.com/guide/topics/connectivity/nfc/nfc#filtering-intents
https://android.stackexchange.com/questions/96564/tapping-an-nfc-tag-which-contains-an-url-how-can-i-override-the-default-actio

Android system will try to start a proper Activity based on the content in a discoverred tag. If there is no proper Activity, it will do nothing, such as writing a text will not open a browser.

WebNFC API is based on [Android NFC library](https://developer.android.com/reference/android/nfc/package-summary), and just being noticed when tag discovered. That means WebNFC is just one of the listeners to the tag events, it can't interfere the default process, can't stop other Application to read the tag after writting. I investigated [the lower level interfaces](https://developer.android.com/reference/android/nfc/package-summary) to see if there is some way to stop the event propgation, just like "event.stopPropagation()" in JS. But unfortunately, I haven't found it. Maybe we can suggest Android NFC library to support such usage.

@riju @reillyeon

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

Received on Tuesday, 24 March 2020 09:17:26 UTC