@tauri-apps/plugin-nfc
Enumerations
Section titled “Enumerations”NFCTypeNameFormat
Section titled “NFCTypeNameFormat”Enumeration Members
Section titled “Enumeration Members”AbsoluteURI
Section titled “AbsoluteURI”AbsoluteURI: 3;Source: undefined
Empty: 0;Source: undefined
Media: 2;Source: undefined
NfcExternal
Section titled “NfcExternal”NfcExternal: 4;Source: undefined
NfcWellKnown
Section titled “NfcWellKnown”NfcWellKnown: 1;Source: undefined
Unchanged
Section titled “Unchanged”Unchanged: 6;Source: undefined
Unknown
Section titled “Unknown”Unknown: 5;Source: undefined
TechKind
Section titled “TechKind”Enumeration Members
Section titled “Enumeration Members”IsoDep
Section titled “IsoDep”IsoDep: 0;Source: undefined
MifareClassic
Section titled “MifareClassic”MifareClassic: 1;Source: undefined
MifareUltralight
Section titled “MifareUltralight”MifareUltralight: 2;Source: undefined
Ndef: 3;Source: undefined
NdefFormatable
Section titled “NdefFormatable”NdefFormatable: 4;Source: undefined
NfcA: 5;Source: undefined
NfcB: 6;Source: undefined
NfcBarcode
Section titled “NfcBarcode”NfcBarcode: 7;Source: undefined
NfcF: 8;Source: undefined
NfcV: 9;Source: undefined
Interfaces
Section titled “Interfaces”NFCRecord
Section titled “NFCRecord”Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
format |
NFCTypeNameFormat |
Source: undefined |
id |
number[] |
Source: undefined |
kind |
number[] |
Source: undefined |
payload |
number[] |
Source: undefined |
ScanOptions
Section titled “ScanOptions”Properties
Section titled “Properties”Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
id |
number[] |
Source: undefined |
kind |
string[] |
Source: undefined |
records |
TagRecord[] |
Source: undefined |
TagRecord
Section titled “TagRecord”Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
id |
number[] |
Source: undefined |
kind |
number[] |
Source: undefined |
payload |
number[] |
Source: undefined |
tnf |
NFCTypeNameFormat |
Source: undefined |
UriFilter
Section titled “UriFilter”Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
host? |
string |
Source: undefined |
pathPrefix? |
string |
Source: undefined |
scheme? |
string |
Source: undefined |
WriteOptions
Section titled “WriteOptions”Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
kind? |
ScanKind |
- | Source: undefined |
message? |
string |
Message displayed in the UI when reading the tag. iOS only. | Source: undefined |
successMessage? |
string |
Message displayed in the UI when the message has been written. iOS only. | Source: undefined |
successfulReadMessage? |
string |
Message displayed in the UI when the tag has been read. iOS only. | Source: undefined |
Type Aliases
Section titled “Type Aliases”ScanKind
Section titled “ScanKind”type ScanKind: object | object;Source: undefined
Variables
Section titled “Variables”RTD_TEXT
Section titled “RTD_TEXT”const RTD_TEXT: number[];Source: undefined
RTD_URI
Section titled “RTD_URI”const RTD_URI: number[];Source: undefined
Functions
Section titled “Functions”isAvailable()
Section titled “isAvailable()”function isAvailable(): Promise<boolean>Returns
Section titled “Returns”Promise<boolean>
Source: undefined
record()
Section titled “record()”function record( format, kind, id, payload): NFCRecordParameters
Section titled “Parameters”| Parameter | Type |
|---|---|
format |
NFCTypeNameFormat |
kind |
string | number[] |
id |
string | number[] |
payload |
string | number[] |
Returns
Section titled “Returns”Source: undefined
scan()
Section titled “scan()”function scan(kind, options?): Promise<Tag>Scans an NFC tag.
import { scan } from "@tauri-apps/plugin-nfc";await scan({ type: "tag" });See https://developer.android.com/develop/connectivity/nfc/nfc#ndef for more information.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
kind |
ScanKind |
|
options? |
ScanOptions |
Returns
Section titled “Returns”Source: undefined
textRecord()
Section titled “textRecord()”function textRecord( text, id?, language?): NFCRecordParameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
text |
string |
undefined |
id? |
string | number[] |
undefined |
language? |
string |
'en' |
Returns
Section titled “Returns”Source: undefined
uriRecord()
Section titled “uriRecord()”function uriRecord(uri, id?): NFCRecordParameters
Section titled “Parameters”| Parameter | Type |
|---|---|
uri |
string |
id? |
string | number[] |
Returns
Section titled “Returns”Source: undefined
write()
Section titled “write()”function write(records, options?): Promise<void>Write to an NFC tag.
import { uriRecord, write } from "@tauri-apps/plugin-nfc";await write([uriRecord("https://tauri.app")], { kind: { type: "ndef" } });If you did not previously call scan with ScanOptions.keepSessionAlive set to true, it will first scan the tag then write to it.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
records |
NFCRecord[] |
|
options? |
WriteOptions |
Returns
Section titled “Returns”Promise<void>
Source: undefined
Tauri 中文网 - 粤ICP备13048890号
Nodejs.cn 旗下网站