This API is available on Firefox OS for privileged or certified applications only.
MozNFCTag contains the basic functions needed to read, write, and inspect NDEF-compatible NFC Tags.
Methods
MozNFCTag.makeReadOnly()- Calling
makeReadOnly()will make the NDEF stored on this tag read only. Avalable in Firefox OS 2.2+. MozNFCTag.format()- Formats this tag as NDEF-compatible. Avalable in Firefox OS 2.2+.
MozNFCTag.readNDEF()readNDEF()retrieves the NDEF contents stored on this Tag, and returns the NDEF as an array ofMozNDEFRecordobjects.MozNFCTag.writeNDEF()writeNDEF()takes an array ofMozNDEFRecordobjects, and writes them to a NDEF-compatible tag.
Properties
MozNFCTag.techListRead only- The supported NFC Technologies of this tag.
MozNFCTag.idRead only- The identifier of this tag.
MozNFCTag.typeRead only- The type of this tag,
MozNFCTag.maxNDEFSizeRead only- The maximum size of NDEF can be stored on this tag.
MozNFCTag.isReadOnlyRead only- Indicate whether the NDEF content stored on this tag read-only or not.
MozNFCTag.isFormatableRead only- Inidicate whether this tag is NDEF-compatible or not.
MozNFCTag.canBeMadeReadOnlyRead only- Indicate whether the NDEF stored on this tag could be configured as read-only or not.
MozNFCTag.isLostRead only- Indicate whether if this tag is already lost. (i.e. is moved out of range)
Specifications
The NFC implementation in Gecko follows the NFC Forum specifications.
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|
| Basic support |
No support |
No support | No support | No support | No support |
| Feature | Android | Firefox Mobile (Gecko) | Firefox OS (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | No support | No support | 2.0 moz [1] | No support | No support | No support |
[1] Available in privileged apps as of Firefox OS 2.2; certified-only before that.
See also
- Using the NFC API
- Using the NFC emulator
- Introduction to NFC (fairly long reference doc, featuring general NFC terms, and some Nokia platform specifics.)