@tauri-apps/plugin-nfc
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
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
| 属性 | 类型 | 描述 | 定义于 |
|---|---|---|---|
keepSessionAlive? | 布尔值 (boolean) | - | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L63 |
message? | string | UI 中显示的消息。仅限 iOS。 | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L65 |
successMessage? | string | UI 中显示的消息,当消息被读取时显示。仅限 iOS。 | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L67 |
| 属性 | 类型 | 定义于 |
|---|---|---|
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 |
| 属性 | 类型 | 描述 | 定义于 |
|---|---|---|---|
kind? | ScanKind | - | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L71 |
message? | string | UI 中显示的消息,当读取标签时显示。仅限 iOS。 | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L73 |
successMessage? | string | UI 中显示的消息,当消息被写入时显示。仅限 iOS。 | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L77 |
successfulReadMessage? | string | UI 中显示的消息,当标签被读取时显示。仅限 iOS。 | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L75 |
type ScanKind: object | object;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L29
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>Promise<boolean>
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L271
function record( format, kind, id, payload): NFCRecord| 参数 | 类型 |
|---|---|
format | NFCTypeNameFormat |
kind | string | number[] |
ID | string | number[] |
载荷 (payload) | string | number[] |
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L110
function scan(kind, options?): Promise<Tag>扫描 NFC 标签。
import { scan } from "@tauri-apps/plugin-nfc";await scan({ type: "tag" });更多信息请参见 https://developer.android.com.cn/develop/connectivity/nfc/nfc#ndef。
| 参数 | 类型 | 描述 |
|---|---|---|
kind | ScanKind | |
选项? | ScanOptions |
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L231
function textRecord( text, id?, language?): NFCRecord| 参数 | 类型 | 默认值 |
|---|---|---|
text | string | 未定义 |
ID? | string | number[] | 未定义 |
language? | string | 'en' |
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L130
function uriRecord(uri, id?): NFCRecord| 参数 | 类型 |
|---|---|
uri | string |
ID? | string | number[] |
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L203
function write(records, options?): Promise<void>写入 NFC 标签。
import { uriRecord, write } from "@tauri-apps/plugin-nfc";await write([uriRecord("https://tauri.org.cn")], { kind: { type: "ndef" } });如果之前未调用 scan 并将 ScanOptions.keepSessionAlive 设置为 true,它将首先扫描标签,然后写入标签。
| 参数 | 类型 | 描述 |
|---|---|---|
records | NFCRecord[] | |
选项? | WriteOptions |
Promise<void>
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/nfc/guest-js/index.ts#L256
© 2025 Tauri 贡献者。CC-BY / MIT