SCPMobileReaderDelegate
Objective-C
@protocol SCPMobileReaderDelegate <SCPReaderInteractionDelegate>
Swift
protocol MobileReaderDelegate : ReaderInteractionDelegate
Implement this protocol to handle a connected Bluetooth reader’s events throughout the lifetime of its connection.
Implementing this delegate is required when connecting to any Bluetooth connected reader, such as the Stripe M2, BBPOS Chipper 2X BT, and the BBPOS WisePad 3.
The provided delegate must be retained by your application until the reader disconnects.
-
The SDK is reporting a deferred software update that is available for the Mobile Reader. This callback is only used for Mobile Reader updates that an integration can install later by calling
-[SCPTerminal installUpdate:].Tap to Pay readers don’t report available optional updates. Mandatory Tap to Pay configuration installation during connection is reported through the installation lifecycle callbacks on
SCPReaderInteractionDelegate.Check the
SCPReaderSoftwareUpdate.requiredAtfield to see when this update will be a required update. Required updates are installed immediately upon connection.This delegate method is most likely to be called right after
connectReader:but applications that stay connected to the reader for long periods of time should expect this method to be called any time the reader is not busy performing a transaction.Declaration
Objective-C
- (void)reader:(nonnull SCPReader *)reader didReportAvailableUpdate:(nonnull SCPReaderSoftwareUpdate *)update;Swift
func reader(_ reader: SCPReader, didReportAvailableUpdate update: SCPReaderSoftwareUpdate)Parameters
readerThe originating reader.
updateAn
SCPReaderSoftwareUpdateobject representing the update to be installed. -
The SDK reported an event from the reader (e.g. a card was inserted).
Declaration
Objective-C
- (void)reader:(nonnull SCPReader *)reader didReportReaderEvent:(SCPReaderEvent)event info:(nullable NSDictionary *)info;Swift
optional func reader(_ reader: SCPReader, didReportReaderEvent event: ReaderEvent, info: [AnyHashable : Any]?)Parameters
readerThe originating reader.
eventThe reader event.
infoAdditional info associated with the event, or nil.
-
The SDK reported the reader’s battery level or charging state has changed.
See
SCPBatteryStatus
Declaration
Objective-C
- (void)reader:(nonnull SCPReader *)reader didReportBatteryLevel:(float)batteryLevel status:(SCPBatteryStatus)status isCharging:(BOOL)isCharging;Swift
optional func reader(_ reader: SCPReader, didReportBatteryLevel batteryLevel: Float, status: BatteryStatus, isCharging: Bool)Parameters
readerThe originating reader.
batteryLevelThe new battery level of the reader, a float from 0.0 to 1.0
statusThe classification of the battery level. - see:
SCPBatteryStatusisChargingYES if the reader is plugged in and charging.