• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
B2G OS
  1. MDN
  2. Archive of obsolete content
  3. B2G OS
  4. B2G OS APIs
  5. MozNDEFRecord
  6. MozNDEFRecord.id

MozNDEFRecord.id

In This Article
  1. Syntax
  2. Example
  3. Value
  4. Specifications
  5. Browser compatibility
  6. See also

The id property of the MozNDEFRecord interface is application dependent (an appropriate id can be used, depending on functionality), but generally will return an NDEF Record identifier. 

Syntax

readonly attribute Uint8Array id;

Example

var tnf     = 0x1;                                                    // NFC Forum Well Known type
var type    = new Uint8Array(NfcUtils.fromUTF8("U"));                 // URL type
var id      = new Uint8Array(NfcUtils.fromUTF8(""));                  // id
var payload = new Uint8Array(NfcUtils.fromUTF8("\u0003mozilla.org")); // URL data, with a short record prefix 0x3 replacing http://
var ndefRecords = [new MozNDEFRecord(tnf, type, id, payload)];

Value

a Uint8Array.

Specifications

The NFC implementation in Gecko follows the NFC Forum specifications.

Browser compatibility

  • Desktop
  • Mobile
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
  • NFC Forum Data Exchange Format Technical Specification
  • Draft W3C NDEF-related formats

Document Tags and Contributors

Tags: 
  • API
  • Firefox OS
  • id
  • MozNDEFRecord
  • NDEFRecord
  • NFC
  • Property
  • Reference
  • Référence
 Contributors to this page: chrisdavidmills, fscholz, teoli
 Last updated by: chrisdavidmills, Feb 27, 2017, 2:09:07 AM
See also
  1. NFC API
  2. Archive
  3. Related pages for NFC API
    1. MozNDEFRecord
    2. MozNFC
    3. MozNFCPeer
    4. MozNFCTag