NFCReaderSessionProtocol

Trait NFCReaderSessionProtocol 

Source
pub unsafe trait NFCReaderSessionProtocol: NSObjectProtocol {
    // Provided methods
    unsafe fn isReady(&self) -> bool
       where Self: Sized + Message { ... }
    unsafe fn alertMessage(&self) -> Retained<NSString>
       where Self: Sized + Message { ... }
    unsafe fn setAlertMessage(&self, alert_message: &NSString)
       where Self: Sized + Message { ... }
    unsafe fn beginSession(&self)
       where Self: Sized + Message { ... }
    unsafe fn invalidateSession(&self)
       where Self: Sized + Message { ... }
    unsafe fn invalidateSessionWithErrorMessage(&self, error_message: &NSString)
       where Self: Sized + Message { ... }
}
Expand description

General reader session functions

See also Apple’s documentation

Provided Methods§

Source

unsafe fn isReady(&self) -> bool
where Self: Sized + Message,

Returns: YES if the reader session is started and ready to use.

The RF discovery polling begins immediately when a reader session is activated successfully. The

 readerSession:didDetectTags: @link/ will be called when a tag is detected.
  
Source

unsafe fn alertMessage(&self) -> Retained<NSString>
where Self: Sized + Message,

Descriptive text message that is displayed on the alert action sheet once tag scanning has started. The string can be update dynamically in any thread context as long as the session is valid. This should be set prior to calling

 beginSession @link/ to display
             the correct message.  Use this string to provide additional context about the NFC reader mode operation.
  
Source

unsafe fn setAlertMessage(&self, alert_message: &NSString)
where Self: Sized + Message,

Setter for alertMessage.

This is copied when set.

Source

unsafe fn beginSession(&self)
where Self: Sized + Message,

Starts the session. The

 [NFCReaderSessionDelegate readerSessionDidBecomeActive:] @link/ will be called when the reader session
                  is activated successfully.  @link [NFCReaderSessionDelegate readerSession:didDetectTags:] @link/ will return tag objects that are
                  conformed to the @link NFCTag @link/ protocol.  @link [NFCReaderSessionDelegate readerSession:didInvalidateWithError:] will return
                  errors related to the session start.
  
Source

unsafe fn invalidateSession(&self)
where Self: Sized + Message,

Closes the reader session. The session cannot be re-used.

Source

unsafe fn invalidateSessionWithErrorMessage(&self, error_message: &NSString)
where Self: Sized + Message,

Closes the reader session. The session cannot be re-used. The specified error message and an error symbol will be displayed momentarily on the action sheet before it is automatically dismissed.

Trait Implementations§

Source§

impl ProtocolType for dyn NFCReaderSessionProtocol

Source§

const NAME: &'static str = "NFCReaderSession"

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 NFCReaderSessionProtocol

Implementations on Foreign Types§

Source§

impl<T> NFCReaderSessionProtocol for ProtocolObject<T>

Implementors§