Motivation
When a barcode is scanned, then the phone will be vibrating/beeping, and the recognized code might be visually highlighted depending on the GUI style used. However, you might want to apply your own logic (i.e. validate that the code is in your database) before accepting a code.
Code Rejection
In order to be able to accept only a subset of the codes, it is necessary to enable code rejection.
Once this is done, you can use rejectCode(Barcode) method to reject individual codes. Here you can find an example where we iterate through all the recognized codes and possibly reject a few of them after calling shouldRejectCode()
which is the method containing the app logic used to decide whether to reject the code or not.
Please note that rejectCode()
must be called from the session queue.