SCPDiscoveryConfiguration
Objective-C
@interface SCPDiscoveryConfiguration : NSObject
Swift
class DiscoveryConfiguration : NSObject
Configuration options for discovering readers.
Objects of this type get passed into the Terminal.shared.discoverReaders()
method to control which devices get discovered, and how.
-
Initializes a discovery configuration with the given discovery method. All discoverable readers for that method will be discovered.
Declaration
Objective-C
- (nonnull instancetype)initWithDiscoveryMethod: (SCPDiscoveryMethod)discoveryMethod simulated:(BOOL)simulated;
Swift
init(discoveryMethod: DiscoveryMethod, simulated: Bool)
Parameters
discoveryMethod
The discovery method to use.
simulated
Whether to use simulated discovery to discover a device simulator. The SDK comes with the ability to simulate behavior without using physical hardware. This makes it easy to quickly test your integration end-to-end, from pairing with a reader to taking payments.
-
This variant of the initializer lets you specify a Location to filter the list of discovered readers.
This filtering behavior is only available when discovering internet readers. Starting a
discoverReaders
call with a bluetooth discovery method will discover all bluetooth readers that can be found, regardless of the location to which those readers have been registered.Declaration
Objective-C
- (nonnull instancetype)initWithDiscoveryMethod: (SCPDiscoveryMethod)discoveryMethod locationId:(nullable NSString *)locationId simulated:(BOOL)simulated;
Swift
init(discoveryMethod: DiscoveryMethod, locationId: String?, simulated: Bool)
Parameters
discoveryMethod
The discovery method to use.
locationId
The optional location ID to filter the discovered list to only readers at the specific location. Currently updating and creating locations is not supported by this SDK and will need to take place on the backend. Only available for the Internet discovery method.
simulated
Whether to use simulated discovery to discover a device simulator. The SDK comes with the ability to simulate behavior without using physical hardware. This makes it easy to quickly test your integration end-to-end, from pairing with a reader to taking payments.
-
The timeout (in seconds) after which
discoverReaders:
should fail. If the value is0
(the default), discoverReaders will never timeout.Note that setting a timeout is not currently supported when using
SCPDiscoveryMethodBluetoothProximity
, or any simulated discovery. If you set a timeout when using these configurations, the timeout will be ignored.Declaration
Objective-C
@property (nonatomic) NSUInteger timeout;
Swift
var timeout: UInt { get set }
-
The method by which to discover readers.
Declaration
Objective-C
@property (nonatomic, readonly) SCPDiscoveryMethod discoveryMethod;
Swift
var discoveryMethod: DiscoveryMethod { get }
-
Whether to use simulated discovery to discover a device simulator.
The Terminal SDK comes with the ability to simulate behavior without using physical hardware. This makes it easy to quickly test your integration end-to-end, from pairing with a reader to taking payments.
Declaration
Objective-C
@property (nonatomic, readonly) BOOL simulated;
Swift
var simulated: Bool { get }
-
A location ID that can be used to filter discovery result so only readers registered to that location are returned. Filtering discovery by a location is only applicable to Internet readers; this parameter must be nil when discovering Bluetooth readers.
Declaration
Objective-C
@property (nonatomic, copy, readonly, nullable) NSString *locationId;
Swift
var locationId: String? { get }
-
Unavailable
Use
initWithDiscoveryMethod:simulated:
Declaration
Objective-C
- (nonnull instancetype)init;
-
Unavailable
Use
initWithDiscoveryMethod:simulated:
Declaration
Objective-C
+ (nonnull instancetype)new;