Skip to content

@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

Property Type Defined in
format NFCTypeNameFormat Source: undefined
id number[] Source: undefined
kind number[] Source: undefined
payload number[] Source: undefined

Property Type Description Defined in
keepSessionAlive? boolean - Source: undefined
message? string Message displayed in the UI. iOS only. Source: undefined
successMessage? string Message displayed in the UI when the message has been read. iOS only. Source: undefined

Property Type Defined in
id number[] Source: undefined
kind string[] Source: undefined
records TagRecord[] Source: undefined

Property Type Defined in
id number[] Source: undefined
kind number[] Source: undefined
payload number[] Source: undefined
tnf NFCTypeNameFormat Source: undefined

Property Type Defined in
host? string Source: undefined
pathPrefix? string Source: undefined
scheme? string Source: undefined

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 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
Parameter Type
format NFCTypeNameFormat
kind string | number[]
id string | number[]
payload string | 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.

Parameter Type Description
kind ScanKind
options? ScanOptions

Promise<Tag>

Source: undefined


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

NFCRecord

Source: undefined


function uriRecord(uri, id?): NFCRecord
Parameter Type
uri string
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.

Parameter Type Description
records NFCRecord[]
options? WriteOptions

Promise<void>

Source: undefined


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