NFCNDEFReaderSessionDelegate

Trait NFCNDEFReaderSessionDelegate 

Source
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§

Source

unsafe fn readerSession_didInvalidateWithError( &self, session: &NFCNDEFReaderSession, error: &NSError, )
where Self: Sized + Message,

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.

Source

unsafe fn readerSession_didDetectNDEFs( &self, session: &NFCNDEFReaderSession, messages: &NSArray<NFCNDEFMessage>, )
where Self: Sized + Message,

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

unsafe fn readerSession_didDetectTags( &self, session: &NFCNDEFReaderSession, tags: &NSArray<ProtocolObject<dyn NFCNDEFTag>>, )
where Self: Sized + Message,

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

unsafe fn readerSessionDidBecomeActive(&self, session: &NFCNDEFReaderSession)
where Self: Sized + Message,

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.

Trait Implementations§

Source§

impl ProtocolType for dyn NFCNDEFReaderSessionDelegate

Source§

const NAME: &'static str = "NFCNDEFReaderSessionDelegate"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn NFCNDEFReaderSessionDelegate

Implementations on Foreign Types§

Source§

impl<T> NFCNDEFReaderSessionDelegate for ProtocolObject<T>

Implementors§