Aller au contenu

@tauri-apps/plugin-nfc

Ce contenu n’est pas encore disponible dans votre langue.

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L80

AbsoluteURI: 3;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L84

Empty: 0;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L81

Media: 2;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L83

NfcExternal: 4;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L85

NfcWellKnown: 1;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L82

Unchanged: 6;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L87

Unknown: 5;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L86


Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L16

IsoDep: 0;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L17

MifareClassic: 1;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L18

MifareUltralight: 2;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L19

Ndef: 3;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L20

NdefFormatable: 4;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L21

NfcA: 5;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L22

NfcB: 6;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L23

NfcBarcode: 7;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L24

NfcF: 8;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L25

NfcV: 9;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L26

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L103

Property Type Defined in
format NFCTypeNameFormat Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L104
id number[] Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L106
kind number[] Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L105
payload number[] Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L107

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L62

Property Type Description Defined in
keepSessionAlive? boolean - Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L63
message? string Message displayed in the UI. iOS only. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L65
successMessage? string Message displayed in the UI when the message has been read. iOS only. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L67

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L97

Property Type Defined in
id number[] Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L98
kind string[] Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L99
records TagRecord[] Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L100

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L90

Property Type Defined in
id number[] Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L93
kind number[] Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L92
payload number[] Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L94
tnf NFCTypeNameFormat Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L91

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L10

Property Type Defined in
host? string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L12
pathPrefix? string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L13
scheme? string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L11

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L70

Property Type Description Defined in
kind? ScanKind - Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L71
message? string Message displayed in the UI when reading the tag. iOS only. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L73
successfulReadMessage? string Message displayed in the UI when the tag has been read. iOS only. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L75
successMessage? string Message displayed in the UI when the message has been written. iOS only. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L77

type ScanKind =
| {
mimeType?: string;
type: "tag";
uri?: UriFilter;
}
| {
mimeType?: string;
techLists?: TechKind[][];
type: "ndef";
uri?: UriFilter;
};

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L29

{
mimeType?: string;
type: "tag";
uri?: UriFilter;
}

{
mimeType?: string;
techLists?: TechKind[][];
type: "ndef";
uri?: UriFilter;
}
Name Type Description Defined in
mimeType? string - Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L38
techLists? TechKind[][] Each of the tech-lists is considered independently and the activity is considered a match if any single tech-list matches the tag that was discovered. This provides AND and OR semantics for filtering desired techs. See https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TECH_DISCOVERED for more information. Examples import type { TechKind } from "@tauri-apps/plugin-nfc" const techLists = [ // capture anything using NfcF [TechKind.NfcF], // capture all MIFARE Classics with NDEF payloads [TechKind.NfcA, TechKind.MifareClassic, TechKind.Ndef] ] Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L59
type "ndef" - Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L36
uri? UriFilter - Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L37

const RTD_TEXT: number[];

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L7


const RTD_URI: number[];

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L8

function isAvailable(): Promise<boolean>;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L271

Promise<boolean>


function record(
format,
kind,
id,
payload
): NFCRecord;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L110

Parameter Type
format NFCTypeNameFormat
kind string | number[]
id string | number[]
payload string | number[]

NFCRecord


function scan(kind, options?): Promise<Tag>;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L231

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>


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

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L130

Parameter Type Default value
text string undefined
id? string | number[] undefined
language? string 'en'

NFCRecord


function uriRecord(uri, id?): NFCRecord;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L203

Parameter Type
uri string
id? string | number[]

NFCRecord


function write(records, options?): Promise<void>;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L256

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>


© 2026 Tauri Contributors. CC-BY / MIT