ProductResolver

The product resolver parses Barcodes e.g. GTINs and provides all meta data about the scanned product like age restrictions, sale stop and embedded units. You can also observe errors like network errors or product not found errors.

You can create a new instance by using the Builder.

Here is a basic example how to show just the ProductConfirmationDialog:

Builder(context)
    .setCodes(ScannedCode.parse(SnabbleUI.project, code))
    .create()
    .resolve()

You can find an advanced sample in the SelfScanningView.lookupAndShowProduct(...)

Types

Link copied to clipboard
class Builder(context: Context, project: Project)

The builder class to create a new instance of the product resolver.

Link copied to clipboard

The age not reached listener.

Link copied to clipboard

The already scanned listener.

Link copied to clipboard
fun interface OnDismissListener

Listener for dismissing the product confirmation dialog. We use this internal to continue the camera preview.

Link copied to clipboard

The network error listener.

Link copied to clipboard
fun interface OnNotForSaleListener

Not for sale listener.

Link copied to clipboard

The product found listener.

Link copied to clipboard

The product not found listener.

Link copied to clipboard
fun interface OnSaleStopListener

Sale stop listener.

Link copied to clipboard

The shelf code scanned listener.

Link copied to clipboard
fun interface OnShowListener

Listener for showing the product confirmation dialog. We use this internal to stop the camera preview.

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Add the resolved product to the cart.

Link copied to clipboard
fun dismiss()

Dismiss the product confirmation dialog.

Link copied to clipboard
fun resolve()

Resolve the product

Link copied to clipboard
fun show()