Package apple.corenfc.protocol
Interface NFCNDEFReaderSessionDelegate
-
public interface NFCNDEFReaderSessionDelegate[@protocol] NFCNDEFReaderSessionDelegate NDEF reader session callbacks. Presence of the -readerSession:didDetectTags: optional method will change the session behaviour into a read-write session where @link 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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidreaderSessionDidBecomeActive(NFCNDEFReaderSession session)readerSessionDidBecomeActive: Gets called when the NFC reader session has become active.voidreaderSessionDidDetectNDEFs(NFCNDEFReaderSession session, NSArray<? extends NFCNDEFMessage> messages)readerSession:didDetectNDEFs: Gets called when the reader detects NFC tag(s) with NDEF messages in the polling sequence.default voidreaderSessionDidDetectTags(NFCNDEFReaderSession session, NSArray<?> tags)readerSession:didDetectTags: Gets called when the reader detects NDEF tag(s) in the RF field.voidreaderSessionDidInvalidateWithError(NFCNDEFReaderSession session, NSError error)readerSession:didInvalidateWithError: Gets called when a session becomes invalid.
-
-
-
Method Detail
-
readerSessionDidDetectNDEFs
void readerSessionDidDetectNDEFs(NFCNDEFReaderSession session, NSArray<? extends NFCNDEFMessage> messages)
readerSession:didDetectNDEFs: 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.- Parameters:
session- The session object used for tag detection.messages- Array of @link NFCNDEFMessage @link/ objects.
-
readerSessionDidDetectTags
default void readerSessionDidDetectTags(NFCNDEFReaderSession session, NSArray<?> tags)
readerSession:didDetectTags: 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.- Parameters:
session- The session object used for NDEF tag detection.tags- Array of @link NFCNDEFTag @link/ objects.
-
readerSessionDidInvalidateWithError
void readerSessionDidInvalidateWithError(NFCNDEFReaderSession session, NSError error)
readerSession:didInvalidateWithError: Gets called when a session becomes invalid. At this point the client is expected to discard the returned session object.- Parameters:
session- The session object that is invalidated.error- The error indicates the invalidation reason.
-
readerSessionDidBecomeActive
default void readerSessionDidBecomeActive(NFCNDEFReaderSession session)
readerSessionDidBecomeActive: Gets called when the NFC reader session has become active. RF is enabled and reader is scanning for tags.- Parameters:
session- The session object in the active state.
-
-