Skip to content

NFCTagReaderSession

treastrain edited this page May 9, 2021 · 4 revisions

NFCTagReaderSession

A reader session for detecting ISO7816, ISO15693, FeliCa, and MIFARE tags.

open class NFCTagReaderSession: NSObject, NFCReaderSessionProtocol 

Inheritance

CoreNFC.NFCTagReaderSessionDelegate, NFCReaderSessionProtocol, NSObject

Properties

readingAvailable

A Boolean value that determines whether the device supports NFC tag reading.

open class var readingAvailable: Bool 

Before creating a reader session, always check the readingAvailable property to determine whether the user’s device supports scanning for and detecting NFC tags.

delegate

The delegate of the reader session.

weak open var delegate: NFCTagReaderSessionDelegate?

sessionQueue

The queue on which the reader session delegate callbacks and completion block handlers are dispatched.

open var sessionQueue: DispatchQueue = .main

isReady

A Boolean value that indicates whether the reader session is started and ready to use.

public var isReady: Bool 

alertMessage

A custom description that helps users understand how they can use NFC reader mode in your app.

public var alertMessage: String = ""

Methods

begin()

Starts the reader session.

public func begin() 

invalidate(errorMessage:)

Closes the reader session and displays an error message to the user.

public func invalidate(errorMessage: String? = nil) 

tagReaderSessionDidBecomeActive(_:)

os(iOS) && !targetEnvironment(macCatalyst)
public func tagReaderSessionDidBecomeActive(_ session: CoreNFC.NFCTagReaderSession) 

tagReaderSession(_:didInvalidateWithError:)

os(iOS) && !targetEnvironment(macCatalyst)
public func tagReaderSession(_ session: CoreNFC.NFCTagReaderSession, didInvalidateWithError error: Error) 

tagReaderSession(_:didDetect:)

os(iOS) && !targetEnvironment(macCatalyst)
public func tagReaderSession(_ session: CoreNFC.NFCTagReaderSession, didDetect tags: [CoreNFC.NFCTag]) 
Clone this wiki locally