SCPLocalMobileReaderDelegate
Objective-C
@protocol SCPLocalMobileReaderDelegate <NSObject>
Swift
protocol LocalMobileReaderDelegate : NSObjectProtocol
Implement this protocol to handle a connected local mobile reader’s events throughout the lifetime of its connection.
Implementing this delegate is required when connecting to any Local Mobile reader.
The provided delegate must be retained by your application until the reader disconnects.
-
The reader has started installing a software update.
Declaration
Objective-C
- (void)localMobileReader:(nonnull SCPReader *)reader didStartInstallingUpdate:(nonnull SCPReaderSoftwareUpdate *)update cancelable:(nullable SCPCancelable *)cancelable;
Swift
func localMobileReader(_ reader: SCPReader, didStartInstallingUpdate update: SCPReaderSoftwareUpdate, cancelable: SCPCancelable?)
Parameters
reader
The originating reader.
update
The
SCPReaderSoftwareUpdate
with anestimatedUpdateTime
that can be used to communicate how long the update is expected to take.cancelable
This cancelable is provided to cancel the installation if needed. Canceling a required update will result in a failed connect with error
SCPErrorUnsupportedReaderVersion
. Some updates will have a nil cancelable because these updates can not be canceled. -
The reader reported progress on a software update.
Declaration
Objective-C
- (void)localMobileReader:(nonnull SCPReader *)reader didReportReaderSoftwareUpdateProgress:(float)progress;
Swift
func localMobileReader(_ reader: SCPReader, didReportReaderSoftwareUpdateProgress progress: Float)
Parameters
reader
The originating reader.
progress
An estimate of the progress of the software update (in the range [0.0, 1.0]).
-
The reader has finished installing an update.
Declaration
Objective-C
- (void)localMobileReader:(nonnull SCPReader *)reader didFinishInstallingUpdate:(nullable SCPReaderSoftwareUpdate *)update error:(nullable NSError *)error;
Swift
func localMobileReader(_ reader: SCPReader, didFinishInstallingUpdate update: SCPReaderSoftwareUpdate?, error: Error?)
Parameters
reader
The originating reader.
update
The update that was being installed, if any.
error
If the installed failed, this will describe the error preventing install. If it succeeded, the error will be
nil
. -
This method is called when the reader begins waiting for input. Use
- [SCPTerminal stringFromReaderInputOptions:]
to get a user facing string for the input options.Declaration
Objective-C
- (void)localMobileReader:(nonnull SCPReader *)reader didRequestReaderInput:(SCPReaderInputOptions)inputOptions;
Swift
func localMobileReader(_ reader: SCPReader, didRequestReaderInput inputOptions: ReaderInputOptions = [])
Parameters
reader
The originating reader.
inputOptions
The armed input options on the reader.
-
This method is called to request that a prompt be displayed in your app. Use
- [SCPTerminal stringFromReaderDisplayMessage:]
to get a user facing string for the prompt.See
SCPReaderDisplayMessageDeclaration
Objective-C
- (void)localMobileReader:(nonnull SCPReader *)reader didRequestReaderDisplayMessage:(SCPReaderDisplayMessage)displayMessage;
Swift
func localMobileReader(_ reader: SCPReader, didRequestReaderDisplayMessage displayMessage: ReaderDisplayMessage)
Parameters
reader
The originating reader.
displayMessage
The message to display to the user.
-
The reader is reporting that, as part of preparing to accept payments, the terms of service has been accepted.
Declaration
Objective-C
- (void)localMobileReaderDidAcceptTermsOfService:(nonnull SCPReader *)reader;
Swift
optional func localMobileReaderDidAcceptTermsOfService(_ reader: SCPReader)
Parameters
reader
The originating reader.