Skip to content
Tauri 中文网

@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

PropertyTypeDefined in
formatNFCTypeNameFormatSource: undefined
idnumber[]Source: undefined
kindnumber[]Source: undefined
payloadnumber[]Source: undefined

ScanOptions

Properties

PropertyTypeDescriptionDefined in
keepSessionAlive?boolean-Source: undefined
message?stringMessage displayed in the UI. iOS only.Source: undefined
successMessage?stringMessage displayed in the UI when the message has been read. iOS only.Source: undefined

Tag

Properties

PropertyTypeDefined in
idnumber[]Source: undefined
kindstring[]Source: undefined
recordsTagRecord[]Source: undefined

TagRecord

Properties

PropertyTypeDefined in
idnumber[]Source: undefined
kindnumber[]Source: undefined
payloadnumber[]Source: undefined
tnfNFCTypeNameFormatSource: undefined

UriFilter

Properties

PropertyTypeDefined in
host?stringSource: undefined
pathPrefix?stringSource: undefined
scheme?stringSource: undefined

WriteOptions

Properties

PropertyTypeDescriptionDefined in
kind?ScanKind-Source: undefined
message?stringMessage displayed in the UI when reading the tag. iOS only.Source: undefined
successfulReadMessage?stringMessage displayed in the UI when the tag has been read. iOS only.Source: undefined
successMessage?stringMessage 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

ParameterType
formatNFCTypeNameFormat
kindstring | number[]
idstring | number[]
payloadstring | number[]

Returns

NFCRecord

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

ParameterTypeDescription
kindScanKind
options?ScanOptions

Returns

Promise<Tag>

Source: undefined


textRecord()

function textRecord(
text,
id?,
language?): NFCRecord

Parameters

ParameterTypeDefault value
textstringundefined
id?string | number[]undefined
language?string'en'

Returns

NFCRecord

Source: undefined


uriRecord()

function uriRecord(uri, id?): NFCRecord

Parameters

ParameterType
uristring
id?string | number[]

Returns

NFCRecord

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

ParameterTypeDescription
recordsNFCRecord[]
options?WriteOptions

Returns

Promise<void>

Source: undefined


Tauri v2.4 中文网 - 粤ICP备13048890号
Nodejs.cn 旗下网站