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§
Sourceunsafe fn isReady(&self) -> bool
unsafe fn isReady(&self) -> bool
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.
Sourceunsafe fn alertMessage(&self) -> Retained<NSString>
unsafe fn alertMessage(&self) -> Retained<NSString>
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.
Sourceunsafe fn setAlertMessage(&self, alert_message: &NSString)
unsafe fn setAlertMessage(&self, alert_message: &NSString)
Setter for alertMessage.
This is copied when set.
Sourceunsafe fn beginSession(&self)
unsafe fn beginSession(&self)
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.
Sourceunsafe fn invalidateSession(&self)
unsafe fn invalidateSession(&self)
Closes the reader session. The session cannot be re-used.
Sourceunsafe fn invalidateSessionWithErrorMessage(&self, error_message: &NSString)
unsafe fn invalidateSessionWithErrorMessage(&self, error_message: &NSString)
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.