Skip to content
Tauri 中文网

@tauri-apps/plugin-nfc

AbsoluteURI: 3;

Source: undefined

Empty: 0;

Source: undefined

Media: 2;

Source: undefined

NfcExternal: 4;

Source: undefined

NfcWellKnown: 1;

Source: undefined

Unchanged: 6;

Source: undefined

Unknown: 5;

Source: undefined


IsoDep: 0;

Source: undefined

MifareClassic: 1;

Source: undefined

MifareUltralight: 2;

Source: undefined

Ndef: 3;

Source: undefined

NdefFormatable: 4;

Source: undefined

NfcA: 5;

Source: undefined

NfcB: 6;

Source: undefined

NfcBarcode: 7;

Source: undefined

NfcF: 8;

Source: undefined

NfcV: 9;

Source: undefined

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

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

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

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

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

PropertyTypeDescriptionDefined in
kind?ScanKind-Source: undefined
message?stringMessage displayed in the UI when reading the tag. iOS only.Source: undefined
successMessage?stringMessage displayed in the UI when the message has been written. iOS only.Source: undefined
successfulReadMessage?stringMessage displayed in the UI when the tag has been read. iOS only.Source: undefined

type ScanKind: object | object;

Source: undefined

const RTD_TEXT: number[];

Source: undefined


const RTD_URI: number[];

Source: undefined

function isAvailable(): Promise<boolean>

Promise<boolean>

Source: undefined


function record(
format,
kind,
id,
payload): NFCRecord
ParameterType
formatNFCTypeNameFormat
kindstring | number[]
idstring | number[]
payloadstring | number[]

NFCRecord

Source: undefined


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.

ParameterTypeDescription
kindScanKind
options?ScanOptions

Promise<Tag>

Source: undefined


function textRecord(
text,
id?,
language?): NFCRecord
ParameterTypeDefault value
textstringundefined
id?string | number[]undefined
language?string'en'

NFCRecord

Source: undefined


function uriRecord(uri, id?): NFCRecord
ParameterType
uristring
id?string | number[]

NFCRecord

Source: undefined


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.

ParameterTypeDescription
recordsNFCRecord[]
options?WriteOptions

Promise<void>

Source: undefined


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