pub unsafe trait NFCNDEFReaderSessionDelegate: NSObjectProtocol {
// Provided methods
unsafe fn readerSession_didInvalidateWithError(
&self,
session: &NFCNDEFReaderSession,
error: &NSError,
)
where Self: Sized + Message { ... }
unsafe fn readerSession_didDetectNDEFs(
&self,
session: &NFCNDEFReaderSession,
messages: &NSArray<NFCNDEFMessage>,
)
where Self: Sized + Message { ... }
unsafe fn readerSession_didDetectTags(
&self,
session: &NFCNDEFReaderSession,
tags: &NSArray<ProtocolObject<dyn NFCNDEFTag>>,
)
where Self: Sized + Message { ... }
unsafe fn readerSessionDidBecomeActive(
&self,
session: &NFCNDEFReaderSession,
)
where Self: Sized + Message { ... }
}Expand description
NDEF reader session callbacks. Presence of the -readerSession:didDetectTags: optional method will change the session behavior into a read-write session where
NFCNDEFTag @link/ objects are returned.
@note A read-write session does not trigger the -readerSession:didDetectNDEFs: method.
@note A read-write session does not get invalidate automatically after a successful tag detection. Invalidation occurs when
the invalidation method is called explicitly or the 60 seconds session time limit is reached.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn readerSession_didInvalidateWithError(
&self,
session: &NFCNDEFReaderSession,
error: &NSError,
)
unsafe fn readerSession_didInvalidateWithError( &self, session: &NFCNDEFReaderSession, error: &NSError, )
Parameter session: The session object that is invalidated.
Parameter error: The error indicates the invalidation reason.
Gets called when a session becomes invalid. At this point the client is expected to discard the returned session object.
Sourceunsafe fn readerSession_didDetectNDEFs(
&self,
session: &NFCNDEFReaderSession,
messages: &NSArray<NFCNDEFMessage>,
)
unsafe fn readerSession_didDetectNDEFs( &self, session: &NFCNDEFReaderSession, messages: &NSArray<NFCNDEFMessage>, )
Parameter session: The session object used for tag detection.
Parameter messages: Array of
NFCNDEFMessage @link/ objects.
@discussion Gets called when the reader detects NFC tag(s) with NDEF messages in the polling sequence. Polling
is automatically restarted once the detected tag is removed from the reader's read range. This method
is only get call if the optional -readerSession:didDetectTags: method is not
implemented.
Sourceunsafe fn readerSession_didDetectTags(
&self,
session: &NFCNDEFReaderSession,
tags: &NSArray<ProtocolObject<dyn NFCNDEFTag>>,
)
unsafe fn readerSession_didDetectTags( &self, session: &NFCNDEFReaderSession, tags: &NSArray<ProtocolObject<dyn NFCNDEFTag>>, )
Parameter session: The session object used for NDEF tag detection.
Parameter tags: Array of
NFCNDEFTag @link/ objects.
@discussion Gets called when the reader detects NDEF tag(s) in the RF field. Presence of this method overrides -readerSession:didDetectNDEFs: and enables
read-write capability for the session.
Sourceunsafe fn readerSessionDidBecomeActive(&self, session: &NFCNDEFReaderSession)
unsafe fn readerSessionDidBecomeActive(&self, session: &NFCNDEFReaderSession)
Parameter session: The session object in the active state.
Gets called when the NFC reader session has become active. RF is enabled and reader is scanning for tags.