Receiving NDEF Messages

Rather than polling for NFC messages, I think it's helpful to think of the
browser as receiving NFC events.

Proposal - replace ontagfound and onpeerfound with onmessage

It should not matter if the messages we receive is from a NFC tag or a NFC
peer.  (On platforms like Windows Phone 8 we can't tell if the message is
from a tag or a peer.) The operating system reads the NDEF message and
fires an event. The NFC API should provide an onmessage handler.

    nfc.onmessage = function(nfcEvent) { ... };

The NfcEvent should include an message property which is an array of
NDEFRecords.

The NfcEvent may include a tag property which is an NfcTag object that can
contain data such tag id, nfc forum type, tag technology, max size,
read-only status, etc.

NfcEvent should replace NFCTagEvent and NFCPeerEvent

NFCTagEvent, NFCPeerEvent and NDEFMessageEvent should be removed.

NDEFMessage should be removed because an NDEFMessage is just an array of
NDEFRecords.

Received on Tuesday, 28 October 2014 03:26:28 UTC