new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Tauri · Plugins and security · all subjects

nfc

16 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

NFC plugin supported platforms

The NFC plugin is available for Android and iOS platforms.

NFC plugin installation commands

The NFC plugin can be installed using: npm run tauri add nfc, yarn run tauri add nfc, pnpm tauri add nfc, bun tauri add nfc, or cargo tauri add nfc.

NFC plugin manual setup Cargo.toml

To manually add the NFC plugin to Cargo.toml in the src-tauri folder, run: cargo add tauri-plugin-nfc --target 'cfg(any(target_os = "android", target_os = "ios"))'

NFC plugin initialization in lib.rs

Initialize the NFC plugin in src-tauri/src/lib.rs by calling app.handle().plugin(tauri_plugin_nfc::init()) inside the setup closure, guarded with #[cfg(mobile)].

NFC JavaScript bindings installation

Install the JavaScript guest bindings using: npm install @tauri-apps/plugin-nfc, yarn add @tauri-apps/plugin-nfc, pnpm add @tauri-apps/plugin-nfc, deno add npm:@tauri-apps/plugin-nfc, or bun add @tauri-apps/plugin-nfc.

NFC plugin iOS minimum version requirement

The NFC plugin requires iOS 14 or higher. Set IPHONEOS_DEPLOYMENT_TARGET to 14.0 in the Xcode project configuration.

NFC plugin iOS Info.plist configuration

Add NFCReaderUsageDescription to src-tauri/Info.ios.plist file with a string value describing why the app needs to scan or write NFC tags, for example: 'Read and write various NFC tags'.

NFC plugin iOS capability configuration

Add NFC capability to the application by configuring the entitlements file at gen/apple/<app-name>_iOS/<app-name>_iOS.entitlements with the key com.apple.developer.nfc.readersession.formats containing an array with the string TAG.

NFC isAvailable JavaScript API

Use the isAvailable() function from @tauri-apps/plugin-nfc to check if the device supports NFC scanning before using the scan and write APIs.

NFC scan JavaScript API example

Call scan(scanType, options) to scan NFC tags. scanType has a type field ('ndef' or 'tag'). options can include keepSessionAlive (boolean), message (string for iOS dialog), and successMessage (string for iOS dialog).

NFC scan Rust API example

Call app.nfc().scan() with a ScanRequest object containing kind (ScanKind::Ndef with mime_type, uri, and tech_list fields) and keep_session_alive (boolean).

NFC scan filtering options

Filter NFC tags by mime type (case sensitive, lowercase), URI scheme/host/pathPrefix, or NFC tag technologies (tech_list). Filtering is only available on Android.

NFC write JavaScript API example

Call write(payload, options) to write to NFC tags. payload is an array of records created using functions like textRecord() and uriRecord(). options can include kind (ScanRequest format), message, successfulReadMessage, and successMessage.

NFC write Rust API example

Call app.nfc().write() with a vector of NfcRecord objects, each containing format (NFCTypeNameFormat::NfcWellKnown), kind (vec of bytes), id (vec of bytes), and payload (vec of bytes).

NFC keepSessionAlive option behavior

The keepSessionAlive option allows writing directly to a scanned tag without rescanning. If not set, the session is recreated on the next write() call, requiring the app to rescan the tag.

NFC default permission capability

Enable NFC plugin access by adding 'nfc:default' to the permissions array in src-tauri/capabilities/default.json.

Give your agent this brain