@tauri-apps/plugin-nfc
Enumerations
NFCTypeNameFormat
Enumeration Members
AbsoluteURI
AbsoluteURI: 3;
Source: undefined
Empty
Empty: 0;
Source: undefined
Media
Media: 2;
Source: undefined
NfcExternal
NfcExternal: 4;
Source: undefined
NfcWellKnown
NfcWellKnown: 1;
Source: undefined
Unchanged
Unchanged: 6;
Source: undefined
Unknown
Unknown: 5;
Source: undefined
TechKind
Enumeration Members
IsoDep
IsoDep: 0;
Source: undefined
MifareClassic
MifareClassic: 1;
Source: undefined
MifareUltralight
MifareUltralight: 2;
Source: undefined
Ndef
Ndef: 3;
Source: undefined
NdefFormatable
NdefFormatable: 4;
Source: undefined
NfcA
NfcA: 5;
Source: undefined
NfcB
NfcB: 6;
Source: undefined
NfcBarcode
NfcBarcode: 7;
Source: undefined
NfcF
NfcF: 8;
Source: undefined
NfcV
NfcV: 9;
Source: undefined
Interfaces
NFCRecord
Properties
Property | Type | Defined in |
---|---|---|
format | NFCTypeNameFormat | Source: undefined |
id | number [] | Source: undefined |
kind | number [] | Source: undefined |
payload | number [] | Source: undefined |
ScanOptions
Properties
Tag
Properties
Property | Type | Defined in |
---|---|---|
id | number [] | Source: undefined |
kind | string [] | Source: undefined |
records | TagRecord [] | Source: undefined |
TagRecord
Properties
Property | Type | Defined in |
---|---|---|
id | number [] | Source: undefined |
kind | number [] | Source: undefined |
payload | number [] | Source: undefined |
tnf | NFCTypeNameFormat | Source: undefined |
UriFilter
Properties
Property | Type | Defined in |
---|---|---|
host? | string | Source: undefined |
pathPrefix? | string | Source: undefined |
scheme? | string | Source: undefined |
WriteOptions
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 |
successfulReadMessage? | string | Message displayed in the UI when the tag has been read. iOS only. | Source: undefined |
successMessage? | string | Message displayed in the UI when the message has been written. iOS only. | Source: undefined |
Type Aliases
ScanKind
type ScanKind: object | object;
Source: undefined
Variables
RTD_TEXT
const RTD_TEXT: number[];
Source: undefined
RTD_URI
const RTD_URI: number[];
Source: undefined
Functions
isAvailable()
function isAvailable(): Promise<boolean>
Returns
Promise
<boolean
>
Source: undefined
record()
function record( format, kind, id, payload): NFCRecord
Parameters
Parameter | Type |
---|---|
format | NFCTypeNameFormat |
kind | string | number [] |
id | string | number [] |
payload | string | number [] |
Returns
Source: undefined
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
Parameter | Type | Description |
---|---|---|
kind | ScanKind | |
options ? | ScanOptions |
Returns
Source: undefined
textRecord()
function textRecord( text, id?, language?): NFCRecord
Parameters
Parameter | Type | Default value |
---|---|---|
text | string | undefined |
id ? | string | number [] | undefined |
language ? | string | 'en' |
Returns
Source: undefined
uriRecord()
function uriRecord(uri, id?): NFCRecord
Parameters
Parameter | Type |
---|---|
uri | string |
id ? | string | number [] |
Returns
Source: undefined
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
Parameter | Type | Description |
---|---|---|
records | NFCRecord [] | |
options ? | WriteOptions |
Returns
Promise
<void
>
Source: undefined
Tauri v2.4 中文网 - 粤ICP备13048890号
Nodejs.cn 旗下网站