Table of Contents

Class NDEFRecord

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The NDEFRecord interface of the Web NFC API provides data that can be read from, or written to, compatible NFC devices, e.g., NFC tags supporting NDEF.
[Value("NDEFRecord")]
public class NDEFRecord
Inheritance
NDEFRecord
Inherited Members

Remarks

Constructors

NDEFRecord()

public NDEFRecord()

NDEFRecord(NDEFRecordInit)

NOTE
Experimental
The NDEFRecord()
constructor of the Web NFC API returns a
newly constructed NDEFRecord object that represents data that can be
read from, or written to, compatible NFC devices; e.g., NFC tags supporting NDEF.
public NDEFRecord(NDEFRecordInit recordInit)

Parameters

recordInit NDEFRecordInit

Remarks

Properties

Data

NOTE
Experimental
The data
property of the NDEFRecord interface returns a
DataView containing the raw bytes of the record's payload.
[Value("data")]
public DataView? Data { get; }

Property Value

DataView

A DataView that contains encoded payload data of the record.

Remarks

Encoding

NOTE
Experimental
The encoding
property of the NDEFRecord interface returns the encoding of
a textual payload, or null otherwise.
[Value("encoding")]
public string? Encoding { get; }

Property Value

string

A string which can be one of the following: "utf-8",
"utf-16", "utf-16le", or "utf-16be".

Remarks

Id

NOTE
Experimental
The id property of the
NDEFRecord interface returns the record identifier, which is an
absolute or relative URL used to identify the record.
[Value("id")]
public string? Id { get; }

Property Value

string

A string.

Remarks

This identifier is created by the generator of the record which is solely responsible
for enforcing record identifier uniqueness. Web NFC does not sign the NFC content, thus
record consumer should not make any assumptions about integrity or authenticity of the
identifier or any other part of the records.

See also on MDN

Lang

NOTE
Experimental
The lang
property of the NDEFRecord interface returns the language of
a textual payload, or null if one was not supplied.
[Value("lang")]
public string? Lang { get; }

Property Value

string

A string.

Remarks

The record might be missing a language tag, for example, if the recorded information is
not locale-specific.

-HTML lang attribute, that declares content language of the document or its elements
-HTTP headers that declare content language: Content-Language and Accept-Language

See also on MDN

MediaType

NOTE
Experimental
The mediaType
property of the NDEFRecord interface returns the {{Glossary("MIME type")}} of the record. This value will be null if recordType is not equal to "mime".
[Value("mediaType")]
public string? MediaType { get; }

Property Value

string

A string, containing the MIME type of the record
payload.

Remarks

RecordType

NOTE
Experimental
The recordType
property of the NDEFRecord interface returns the record type of the record.
[Value("recordType")]
public string RecordType { get; }

Property Value

string

A string which can be one of the following:

Remarks

Methods

ToRecords()

NOTE
Experimental
The toRecords()
method of the NDEFRecord interface converts
Data to a sequence of records based on
RecordType, and returns the result. This allows
parsing the payloads of record types which may contain nested records, such
as smart poster and external type records.
[Value("toRecords")]
public List<NDEFRecord>? ToRecords()

Returns

List<NDEFRecord>

A list of NDEFRecords.

Remarks