Nfc Read Manager
Android implementation of NfcReadManager. Handles NFC tag scanning using the Android NFC Adapter in Reader Mode.
UI is delegated to NfcScanBottomSheet; tag parsing to NfcTagParser.kt.
Manager class for handling NFC reading operations.
This is an expected class with platform-specific implementations for Android and iOS. It manages the NFC scanning process, provides results via a StateFlow, and handles the UI (like bottom sheets on Android or native dialogs on iOS).
iOS implementation of NfcReadManager. Handles NFC tag scanning using CoreNFC's NFCTagReaderSession. The system manages the scanning UI; RegisterManager is a no-op.
Tag parsing is delegated to NfcTagParser.kt.
Properties
A StateFlow that emits the current NfcReadResult during the scanning process.
A StateFlow that emits the current NfcReadResult of the NFC scanning process.
A StateFlow that emits the current NfcReadResult.
Functions
Callback triggered when an NFC tag is discovered. Cancels the timeout immediately, then parses the tag and emits the result.
Registers the manager with the current Activity and Context, and renders the scan UI. The scope is cancelled when the composable leaves composition entirely. The NFC adapter reference is refreshed on Activity recreation (e.g. configuration change).
A Composable function that registers the manager within the Compose UI hierarchy. This is typically used to handle lifecycle events and show scanning-related UI components.
Registers the manager (no-op on iOS — the system owns the scanning UI).
Starts the NFC scanning process. Validates the adapter and NFC state, then enables Reader Mode with a timeout.
Starts the NFC scanning process.
Starts the NFC scanning process.
Stops the NFC scanning process and disables Reader Mode.
Stops the NFC scanning process.
Stops the NFC scanning process.
Invoked when tags are detected. Only the first tag in the field is processed.
Invoked when the session is invalidated. The pending result (captured before invalidation) is emitted here — after the system dialog has fully dismissed — to avoid UI conflicts.