Table of Contents

Class NDEFReader

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The NDEFReader interface of the Web NFC API is used to read from and write data to compatible NFC devices, e.g., NFC tags supporting NDEF, when these devices are within the reader's magnetic induction field.
[Value("NDEFReader")]
public class NDEFReader : EventTarget
Inheritance
NDEFReader
Inherited Members

Remarks

Constructors

NDEFReader()

NOTE
Experimental
The NDEFReader()
constructor of the NDEFReader interface returns a
new NDEFReader object, which is used to read NDEF messages from
compatible NFC devices, e.g., NDEF tags, within the reader's magnetic induction
field.
public NDEFReader()

Remarks

Properties

Onreading

[Value("onreading")]
public EventHandlerNonNull Onreading { get; set; }

Property Value

EventHandlerNonNull

Onreadingerror

[Value("onreadingerror")]
public EventHandlerNonNull Onreadingerror { get; set; }

Property Value

EventHandlerNonNull

Methods

MakeReadOnly(NDEFMakeReadOnlyOptions)

[Value("makeReadOnly")]
public Task<GlobalObject.Undefined> MakeReadOnly(NDEFMakeReadOnlyOptions options = null)

Parameters

options NDEFMakeReadOnlyOptions

Returns

Task<GlobalObject.Undefined>

Scan(NDEFScanOptions)

NOTE
Experimental
The scan() method of the NDEFReader interface activates a reading device and returns a {{jsxref("Promise")}} that either resolves when an NFC tag read operation is scheduled or rejects if a hardware or permission error is encountered. This method triggers a permission prompt if the "nfc" permission has not been previously granted.
[Value("scan")]
public Task<GlobalObject.Undefined> Scan(NDEFScanOptions options = null)

Parameters

options NDEFScanOptions

Returns

Task<GlobalObject.Undefined>

A Promise that resolves immediately after
scheduling read operations for the NFC adapter.

Remarks

Write(Union179, NDEFWriteOptions)

NOTE
Experimental
The write() method of the NDEFReader interface attempts to write an NDEF message to a tag and returns a {{jsxref("Promise")}} that either resolves when a message has been written to the tag or rejects if a hardware or permission error is encountered. This method triggers a permission prompt if the "nfc" permission has not been previously granted.
[Value("write")]
public Task<GlobalObject.Undefined> Write(Union179 message, NDEFWriteOptions options = null)

Parameters

message Union179
options NDEFWriteOptions

Returns

Task<GlobalObject.Undefined>

A Promise that either resolves when a message has been written to the tag or rejects if a hardware or permission error is encountered.

Remarks