Confirmed users
118
edits
Line 244: | Line 244: | ||
Sample example to demonstrate the construction of an url as an NDEF Message: | Sample example to demonstrate the construction of an url as an NDEF Message: | ||
''var tnf = NDEF.TNF_WELL_KNOWN; | |||
var type = NDEF.RTD_URI; | |||
var id = new Uint8Array(); | |||
// Short Record, 0x3 or "http://" | |||
var payload = new Uint8Array(NfcUtils.fromUTF8( | |||
'\u0003mozilla.org')); | '\u0003mozilla.org')); | ||
var urlNDEF = new MozNDEFRecord(tnf, type, id, payload); | |||
// Call writeNdef() API with urlNDEF'' | |||
== NDEF Connect Example == | == NDEF Connect Example == |