NfcReadManager

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

Android implementation of NfcReadManager. This class handles NFC tag scanning using the Android NFC Adapter in Reader Mode.

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. This class handles NFC tag scanning using CoreNFC's NFCTagReaderSession.

Constructors

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

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 during the scanning process.

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. Parses the tag data and updates nfcResult.

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

A Composable function that registers the manager with the current Activity and Context. It handles the lifecycle of the NFC adapter and displays the scan bottom sheet when active.

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.

A Composable function that registers the manager. On iOS, this is currently a no-op as the scanning UI is handled by the system.

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

Starts the NFC scanning process. Checks if the NFC adapter is available and enabled, then enables Reader Mode.

expect fun startScanning()

Starts the NFC scanning process.

actual fun startScanning()

Starts the NFC scanning process by initiating an NFCTagReaderSession. Checks if NFC reading is available on the device before starting.

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 and invalidates the current session.

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

Invoked when one or more NFC tags are detected.

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

Invoked when the session is invalidated, either by the user or due to an error.

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