- From: Kenneth Rohde Christiansen via GitHub <sysbot+gh@w3.org>
- Date: Thu, 27 Sep 2018 08:33:52 +0000
- To: public-web-nfc@w3.org
kenchris has just created a new issue for https://github.com/w3c/web-nfc: == Use addEventListener instead of watch == I don't recall why we invented the watch, but it feels a bit like its own thing, instead of being aligned with the platform. We could go with a `startNotifications()` approach like WebBluetooth. ```js navigator.nfc.addEventListener('exchange', message => { for (let record of message.records) { let article =/[aeio]/.test(record.data.title) ? "an" : "a"; console.log(`${record.data.name} is ${article} ${record.data.title}`); } },{ url: document.baseURI, recordType: "json" }); navigator.nfc.startNotifications(); ``` Please view or discuss this issue at https://github.com/w3c/web-nfc/issues/152 using your GitHub account
Received on Thursday, 27 September 2018 08:33:57 UTC