there is a data confirmation mode that you can use which will cover this scenario. In this mode, the trigger is lock for a certain time unless you explicitly acknowledge the data from the app. The trigger lockout time can be configured. The other possibility is to disable the trigger temporally and re-enable it when your app is ready.
Have a look at the github singleentry-ios (https://github.com/SocketMobile/singleentryswift-ios) it has a code example of Data Confirmation :
func onDecodedDataResult(_ result: Int, device: DeviceInfo!, decodedData: ISktScanDecodedData!) {
print("onDecodedDataResult in the detail view")
if result==ESKT_NOERROR {
let rawData = decodedData.getData()
let rawDataSize = decodedData.getSize()
let data = Data(bytes: UnsafePointer<UInt8>(rawData!), count: Int(rawDataSize))
print("Size: \(rawDataSize)")
print("data: \(data)")
let str = NSString(data: data, encoding: String.Encoding.utf8.rawValue)
let string = str as! String
print("Decoded Data \(string)")
self.decodedData.text = string
// this code can be removed if the application is not interested by
// the host Acknowledgment for the decoded data
#if HOST_ACKNOWLEDGMENT
ScanApiHelper.shared().postSetDataConfirmationOkDevice(device, target: self, response: #selector(onSetDataConfirmation(_:)))
#endif
}
}
#if HOST_ACKNOWLEDGMENT
func onSetDataConfirmation(_ scanObj: ISktScanObject){
let result = scanObj.msg().result()
if result != ESKT_NOERROR {
print("error trying to confirm the decoded data: \(result)")
}
}
#endif
The scanner needs to be configured once to this mode:
#if HOST_ACKNOWLEDGMENT
scanApiHelper?.postGetLocalAcknowledgmentDevice(deviceInfo, target: self, response: #selector(onGetLocalAcknowledgment(_:)))
scanApiHelper?.postGetDecodeActionDevice(deviceInfo, target: self, response: #selector(onGetDecodeAction(_:)))
#else // to remove the Host Acknowledgment if it was set before
scanApiHelper?.postGetLocalAcknowledgmentDevice(deviceInfo, target: self, response: #selector(onGetLocalAcknowledgmentLocalAck(_:)))
scanApiHelper?.postGetDecodeActionDevice(deviceInfo, target: self, response: #selector(onGetDecodeActionLocalAck(_:)))
#endif
I hope this helps.