Samsung Electronics logo

Handling NDEF Messages

Learning how to create NDEF messages is a basic NFC management skill:

  1. To create an NDEF URI record, create an NDEFRecordURI interface instance and specify the URI parameter.

    Additionally, you can create instances of the NDEFRecord, NDEFRecordText, or NDEFRecordMedia interfaces based on the record type to be created.

    var newRecord = new webapis.NDEFRecordURI("");
  2. Create an NDEFMessage interface instance:

    var newMessage = new webapis.NDEFMessage(); 
  3. To add an NDEF record to an NDEF message, use the records attribute of the NDEFMessage interface:

    newMessage.records[0] = newRecord;