Scanning
Before starting a transaction, scan for available readers with DeviceScanService.
let deviceService = DeviceScanService()
deviceService.scan { (result: DeviceResult) in
switch result {
case let .success(devices, isScanning):
for device in devices {
// Select and retain the device for the transaction.
}
case let .error(error, isScanning):
// Handle the scan error.
}
}
Stop scanning when it is no longer needed:
deviceService.stopScanning()
After selecting a device from the scan results, provide it when the transaction flow requests a reader. Apple Tap to Pay is returned as another available device when the device supports it and its installer was registered in the SDK configuration.