@tauri-apps/plugin-nfc
このコンテンツはまだ日本語訳がありません。
AbsoluteURI: 3;Empty: 0;Media: 2;NfcExternal: 4;NfcWellKnown: 1;Unchanged: 6;Unknown: 5;IsoDep: 0;MifareClassic: 1;MifareUltralight: 2;Ndef: 3;NdefFormatable: 4;NfcA: 5;NfcB: 6;NfcBarcode: 7;NfcF: 8;NfcV: 9;| Property | Type | Description | Defined in |
|---|---|---|---|
keepSessionAlive? | boolean | - | Source: https://github.com/bearBoy80/tauri/blob/v2/packages/plugins-workspace/plugins/nfc/guest-js/index.ts#L63 |
message? | string | Message displayed in the UI. iOS only. | Source: https://github.com/bearBoy80/tauri/blob/v2/packages/plugins-workspace/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/bearBoy80/tauri/blob/v2/packages/plugins-workspace/plugins/nfc/guest-js/index.ts#L67 |
| Property | Type | Defined in |
|---|---|---|
id | number[] | Source: https://github.com/bearBoy80/tauri/blob/v2/packages/plugins-workspace/plugins/nfc/guest-js/index.ts#L98 |
kind | string[] | Source: https://github.com/bearBoy80/tauri/blob/v2/packages/plugins-workspace/plugins/nfc/guest-js/index.ts#L99 |
records | TagRecord[] | Source: https://github.com/bearBoy80/tauri/blob/v2/packages/plugins-workspace/plugins/nfc/guest-js/index.ts#L100 |
| Property | Type | Defined in |
|---|---|---|
host? | string | Source: https://github.com/bearBoy80/tauri/blob/v2/packages/plugins-workspace/plugins/nfc/guest-js/index.ts#L12 |
pathPrefix? | string | Source: https://github.com/bearBoy80/tauri/blob/v2/packages/plugins-workspace/plugins/nfc/guest-js/index.ts#L13 |
scheme? | string | Source: https://github.com/bearBoy80/tauri/blob/v2/packages/plugins-workspace/plugins/nfc/guest-js/index.ts#L11 |
| Property | Type | Description | Defined in |
|---|---|---|---|
kind? | ScanKind | - | Source: https://github.com/bearBoy80/tauri/blob/v2/packages/plugins-workspace/plugins/nfc/guest-js/index.ts#L71 |
message? | string | Message displayed in the UI when reading the tag. iOS only. | Source: https://github.com/bearBoy80/tauri/blob/v2/packages/plugins-workspace/plugins/nfc/guest-js/index.ts#L73 |
successMessage? | string | Message displayed in the UI when the message has been written. iOS only. | Source: https://github.com/bearBoy80/tauri/blob/v2/packages/plugins-workspace/plugins/nfc/guest-js/index.ts#L77 |
successfulReadMessage? | string | Message displayed in the UI when the tag has been read. iOS only. | Source: https://github.com/bearBoy80/tauri/blob/v2/packages/plugins-workspace/plugins/nfc/guest-js/index.ts#L75 |
type ScanKind: object | object;const RTD_TEXT: number[];const RTD_URI: number[];function isAvailable(): Promise<boolean>Promise<boolean>
function record( format, kind, id, payload): NFCRecord| Parameter | Type |
|---|---|
format | NFCTypeNameFormat |
kind | string | number[] |
id | string | number[] |
payload | string | number[] |
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 |
function textRecord( text, id?, language?): NFCRecord| Parameter | Type | Default value |
|---|---|---|
text | string | undefined |
id? | string | number[] | undefined |
language? | string | 'en' |
function uriRecord(uri, id?): NFCRecord| Parameter | Type |
|---|---|
uri | string |
id? | string | number[] |
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>
© 2025 Tauri Contributors. CC-BY / MIT