How to enable the AR Model for Match Filter

matchFilter
We added a flexible result filtering mechanism that lets integrators control which decoded results are returned. The filter supports exact string matching, regex-based matching (including regex flags such as case-insensitive mode), and multi-token input. Each decoded result now carries an explicit match state (isMatched), and behavior is controlled through returnOnlyMatchedResults: when enabled, only matching results are returned; when disabled, non-matching results can still be returned but are clearly marked as unmatched.

Here are the steps to enable the AR Model for Match Filter.

What MatchFilter does
When you set:

                                config.arConfig.arMode = BarkoderARMode.MatchFilter;
            
            

all detected barcodes are considered matched by default until you configure a matchFilter.
the AR mode uses the barcode values configured in matchFilter to determine which detected barcode should be visually highlighted.
You also need to configure the actual barcode value(s) you want to match:

                                bkdView.config.getDecoderConfig().matchFilter =
        "[\"1234567890128\"]";

bkdView.config.arConfig.arMode = BarkoderARMode.MatchFilter;

bkdView.config.arConfig.returnOnlyMatchedResults = false;
bkdView.config.arConfig.displayOnlyMatchedResults = false;
            
            

In this example, the filter contains 1234567890128.
What you will see
With this configuration:
All barcodes are still scanned/detected.
The barcode matching 1234567890128 will be visually highlighted with green overlay on the screen.
Other detected barcodes will not be highlighted as a match.
returnOnlyMatchedResults

                                bkdView.config.arConfig.returnOnlyMatchedResults = false;
            
            

This controls what results are returned to your application.

  • false → all detected barcodes are returned, including non-matching ones.
  • true → only barcodes that match the matchFilter are returned.

So if you want to continue receiving all scanned barcodes, keep this as false.

displayOnlyMatchedResults

                                bkdView.config.arConfig.displayOnlyMatchedResults = false;
            
            

This controls what is displayed/highlighted in the AR view.

  • false → all detected barcodes can be displayed in the AR view, while the matching barcode is identified/highlighted according to MatchFilter.
  • true → only the barcodes matching the matchFilter are displayed in the AR view.

So this setting is about the visual AR experience.