NfcReadManager

internal actual class NfcReadManager(config: NfcConfig) : NfcAdapter.ReaderCallback(source)

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.

internal expect class NfcReadManager(config: NfcConfig)(source)

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).

internal actual class NfcReadManager(config: NfcConfig) : NSObject, NFCTagReaderSessionDelegateProtocol(source)

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.

Constructors

Link copied to clipboard
actual constructor(config: NfcConfig)
expect constructor(config: NfcConfig)
actual constructor(config: NfcConfig)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
expect val description: String?
Link copied to clipboard
expect val hash: NSUInteger
Link copied to clipboard
actual val nfcResult: StateFlow<NfcReadResult>

A StateFlow that emits the current NfcReadResult during the scanning process.

expect val nfcResult: StateFlow<NfcReadResult>

A StateFlow that emits the current NfcReadResult of the NFC scanning process.

actual val nfcResult: StateFlow<NfcReadResult>

A StateFlow that emits the current NfcReadResult.

Link copied to clipboard
expect val superclass: ObjCClass?

Functions

Link copied to clipboard
expect open override fun class(): ObjCClass?
Link copied to clipboard
expect open override fun conformsToProtocol(aProtocol: objcnames/classes/Protocol??): Boolean
Link copied to clipboard
expect open fun copy(): Any?
Link copied to clipboard
expect open fun debugDescription(): String?
Link copied to clipboard
expect open override fun description(): String?
Link copied to clipboard
expect open fun doesNotRecognizeSelector(aSelector: COpaquePointer?)
Link copied to clipboard
expect open fun finalize()
Link copied to clipboard
expect open fun forwardingTargetForSelector(aSelector: COpaquePointer?): Any?
Link copied to clipboard
expect open fun forwardInvocation(anInvocation: objcnames/classes/NSInvocation??)
Link copied to clipboard
expect open override fun hash(): NSUInteger
Link copied to clipboard
expect open fun init(): NSObject?
Link copied to clipboard
expect open override fun isEqual(object: Any?): Boolean
Link copied to clipboard
expect open override fun isKindOfClass(aClass: ObjCClass?): Boolean
Link copied to clipboard
expect open override fun isMemberOfClass(aClass: ObjCClass?): Boolean
Link copied to clipboard
expect open override fun isProxy(): Boolean
Link copied to clipboard
expect open fun methodForSelector(aSelector: COpaquePointer?): IMP?
Link copied to clipboard
expect open fun methodSignatureForSelector(aSelector: COpaquePointer?): objcnames/classes/NSMethodSignature??
Link copied to clipboard
expect open fun mutableCopy(): Any?
Link copied to clipboard
open override fun onTagDiscovered(tag: Tag?)

Callback triggered when an NFC tag is discovered. Cancels the timeout immediately, then parses the tag and emits the result.

Link copied to clipboard
expect open override fun performSelector(aSelector: COpaquePointer?): Any?
expect open override fun performSelector(aSelector: COpaquePointer?, withObject: Any?): Any?
expect open override fun performSelector(aSelector: COpaquePointer?, withObject: Any?, _withObject: Any?): Any?
Link copied to clipboard

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).

Link copied to clipboard
expect open override fun respondsToSelector(aSelector: COpaquePointer?): Boolean
Link copied to clipboard
actual fun startScanning()

Starts the NFC scanning process. Validates the adapter and NFC state, then enables Reader Mode with a timeout.

expect fun startScanning()

Starts the NFC scanning process.

actual fun startScanning()

Starts the NFC scanning process.

Link copied to clipboard
actual fun stopScanning()

Stops the NFC scanning process and disables Reader Mode.

expect fun stopScanning()

Stops the NFC scanning process.

actual fun stopScanning()

Stops the NFC scanning process.

Link copied to clipboard
expect open override fun superclass(): ObjCClass?
Link copied to clipboard
open override fun tagReaderSession(session: NFCTagReaderSession, didDetectTags: List<*>)

Invoked when tags are detected. Only the first tag in the field is processed.

open override fun tagReaderSession(session: NFCTagReaderSession, didInvalidateWithError: NSError)

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.

Link copied to clipboard
open override fun tagReaderSessionDidBecomeActive(session: NFCTagReaderSession)