BlinkID / blinkid-cordova

ID scanning for cross-platform apps built with Cordova and Phonegap.
48 stars 34 forks source link

Not able to catch timeout #108

Closed vishalgole closed 4 years ago

vishalgole commented 5 years ago

Hi team,

I am using this plugin. But sometimes user scans only chip and not focusing on ikad to be in frame.. In that case we need to show timeout message. But I am not able to find any timeout.

I did function timeout, but its not closing plugin activity. Can you please let me know how to put timeout for scanning?

After sometime it should get close with timeout error..

i1E commented 5 years ago

Hi @vishalgole,

this is documentation for timeout that can be set by using this property on the RecognizerCollection:

Set the duration in milliseconds that needs to pass since scanning has begun in order to define timeout. Please be aware that time counting does not start from the moment when scanning starts. Instead it starts from the moment when at least one Recognizer.Result inside recognizers in this collection changes its state to either UNCERTAIN or VALID. The reason for this is the better user experience in cases when for example timeout is set to 10 seconds and user starts scanning and leaves device lying on table for 9 seconds and then points the device towards the object it wants to scan: in such case it is better to let that user scan the object it wants instead of completing scan with empty scan result as soon as 10 seconds timeout ticks out.

This means that time counting will not be started until at least one field from the document has been successfully recognized.

This is the only timeout that is supported out of the box by our plugin. If you want different scanning logic, you can modify the plugin source code and extend functionalities, build your own scan activity/overlay in native part of the plugin (for Android and iOS).

Cerovec commented 4 years ago

Hi @vishalgole,

We're closing this issue for now. Please let us know if you still face any issues with this.

Thanks, Jurica.