PPRetailDeviceManager Class Reference

Inherits from PPRetailObject : NSObject
Declared in PPRetailDeviceManager.h

Overview

DeviceManager is responsible for exposing APIs regarding the devices. Currently, you can use DeviceManager to prompt the List to select the device or set/get the active device.

– shouldStopScanning:

Utility method to check if search and connect APIs should be invoked again if an error is returned on previous invocation.

- (BOOL)shouldStopScanning:(PPRetailError *_Nullable)error

Discussion

Utility method to check if search and connect APIs should be invoked again if an error is returned on previous invocation.

Declared In

PPRetailDeviceManager.h

– searchAndConnect:callback:

Search for readers according to the passed reader configuration

- (void)searchAndConnect:(PPRetailReaderConfiguration *_Nullable)readerConfig callback:(PPRetailDeviceManagerConnectionHandler _Nullable)callback

Discussion

Search for readers according to the passed reader configuration

Declared In

PPRetailDeviceManager.h

– searchAndConnect:

Show a list of connected credit card readers. If there is more than 1 devices. Select one of them to use it for transaction.

- (void)searchAndConnect:(PPRetailDeviceManagerConnectionHandler _Nullable)callback

Discussion

Show a list of connected credit card readers. If there is more than 1 devices. Select one of them to use it for transaction.

Declared In

PPRetailDeviceManager.h

– searchAndConnectWithoutCallback

Show a list of connected credit card readers. If there is more than 1 devices. Select one of them to use it for transaction.

- (void)searchAndConnectWithoutCallback

Discussion

Show a list of connected credit card readers. If there is more than 1 devices. Select one of them to use it for transaction.

Declared In

PPRetailDeviceManager.h

– connectToLastActiveReader:

Try connecting to the last active credit card reader

- (void)connectToLastActiveReader:(PPRetailDeviceManagerConnectionHandler _Nullable)callback

Discussion

Try connecting to the last active credit card reader

Declared In

PPRetailDeviceManager.h

– scanAndAutoConnectToBluetoothReader:callback:

Tries to connect to the Bluetooth reader with the specified name. If no name is passed then connection to first discovered bluetooth reader is attempted. To check if this API should be invoked again on receiving an error use {@link #shouldStopScanning} To stop an ongoing scan use {@link #stopScanningForBluetoothReaders}

- (void)scanAndAutoConnectToBluetoothReader:(NSString *_Nullable)readerName callback:(PPRetailDeviceManagerConnectionHandler _Nullable)callback

Discussion

Tries to connect to the Bluetooth reader with the specified name. If no name is passed then connection to first discovered bluetooth reader is attempted. To check if this API should be invoked again on receiving an error use {@link #shouldStopScanning} To stop an ongoing scan use {@link #stopScanningForBluetoothReaders}

Declared In

PPRetailDeviceManager.h

– setActiveReader:

Sets the active reader

- (void)setActiveReader:(PPRetailPaymentDevice *_Nullable)pd

Discussion

Sets the active reader

Declared In

PPRetailDeviceManager.h

– isConnectedToMiura

checks if any Miura device is connected

- (BOOL)isConnectedToMiura

Discussion

checks if any Miura device is connected

Declared In

PPRetailDeviceManager.h

– getActiveReader

Returns the selected device

- (PPRetailPaymentDevice *_Nullable)getActiveReader

Discussion

Returns the selected device

Declared In

PPRetailDeviceManager.h

– getDiscoveredDevices

Get a list of paired/discovered devices

- (NSArray *_Nullable)getDiscoveredDevices

Discussion

Get a list of paired/discovered devices

Declared In

PPRetailDeviceManager.h

– getLastActiveBluetoothReader

Get the name of last active reader

- (NSString *_Nullable)getLastActiveBluetoothReader

Discussion

Get the name of last active reader

Declared In

PPRetailDeviceManager.h

– getPairedBluetoothDevices:

Get a list of paired devices

- (void)getPairedBluetoothDevices:(PPRetailDeviceManagerPairedBTDevicesHandler _Nullable)callback

Discussion

Get a list of paired devices

Declared In

PPRetailDeviceManager.h

– stopScanningForBluetoothReaders

Stop scanning for Bluetooth devices Use this API in conjunction with {@link #scanAndAutoConnectToBluetoothReader}

- (void)stopScanningForBluetoothReaders

Discussion

Stop scanning for Bluetooth devices Use this API in conjunction with {@link #scanAndAutoConnectToBluetoothReader}

Declared In

PPRetailDeviceManager.h

– addDeviceDiscoveredListener:

Add a listener for the deviceDiscovered event

- (PPRetailDeviceDiscoveredSignal _Nullable)addDeviceDiscoveredListener:(PPRetailDeviceDiscoveredEvent _Nullable)listener

Return Value

PPRetailDeviceDiscoveredSignal an object that can be used to remove the listener when you’re done with it.

Discussion

Add a listener for the deviceDiscovered event

Declared In

PPRetailDeviceManager.h

– removeDeviceDiscoveredListener:

Remove a listener for the deviceDiscovered event given the signal object that was returned from addDeviceDiscoveredListener

- (void)removeDeviceDiscoveredListener:(PPRetailDeviceDiscoveredSignal _Nullable)listenerToken

Discussion

Remove a listener for the deviceDiscovered event given the signal object that was returned from addDeviceDiscoveredListener

Declared In

PPRetailDeviceManager.h