WebAPI/WebNFC
< WebAPI
Jump to navigation
Jump to search
Preliminary scope
- explicitly NDEF-only for now (navigator.mozNfc.ndef), other technologies to be investigated
- read-only, no tag creation
- dispatch all discovered NDEF tags to the "tagdiscovered" event, privileged web app does filtering and dispatches e.g. via WebIntents.
Example
navigator.mozNfc.ndef.ontagdiscovered = function (event) { console.log("Discovered an NDEF message with " + event.message.records.length + " records."); event.message.records.forEach(function (record) { console.log("Found a " + record.tnf + " record" + " of type " + record.type + " with ID " + record.id + " and payload " + record.payloadText); // record.payloadArrayBuffer is an typed array representation of the payload }); };
Proposed API
...
Implementation
- See bug 674741
- Engineers: Markus Neubrand, Arno Puder, Philipp von Weitershausen