Scanning Mode

Automatically adjust screen brightness for optimal QR code scanning in your mobile app.

Overview

Scanning Mode is a feature that intelligently manages your device's screen brightness when displaying QR codes or barcodes. This ensures QR codes remain scannable even in bright environments or when users have low screen brightness settings.

Prerequisites

  1. Install the Despia plugin from WeWeb Marketplace

  2. Verify installation: AssetsLibrary → check for "Despia package"

Installation

  1. Navigate to your WeWeb editor

  2. Go to Assets Library → Click the book icon

  3. Verify the Despia plugin is installed

    • If not installed: Go to Marketplace → Search "Despia" → Install the plugin

Setup Instructions

Step 1: Add the Despia Native Element

  1. Open the page where you want to implement scanning mode

  2. Go to Assets panel

  3. Find and add the Despia Native element from the Despia provider

  4. Important: Place this element as the first item on your page

Step 2: Configure Scanning Mode Actions

You can control scanning mode through workflows on any trigger (buttons, popups, page load, etc.).

Create a Workflow

  1. Select your trigger element (e.g., button)

  2. Add a new workflow

  3. Add action: Execute Component Action

  4. Select: Despia Plugin Component

  5. Choose: Set Scanning Mode

  6. Configure the mode parameter

Mode Options

Mode

Description

Use Case

on

Forces maximum screen brightness

When showing a QR code

off

Returns to user's original brightness

When closing QR code display

auto

Device sensors determine if brightness adjustment is needed

Adaptive scanning based on environment

Implementation Example

Basic QR Code Display Flow

  1. Show QR Code: Set scanning mode to "on" or "auto"

  2. Hide QR Code: Set scanning mode to "off"

Dynamic Configuration

The mode parameter accepts:

  • Static values ("on", "off", "auto")

  • Variables

  • Formulas

This allows you to dynamically control scanning mode based on user preferences or app conditions.

Deployment

Changes to scanning mode functionality deploy instantly:

  1. Publish your changes in WeWeb

  2. Updates apply immediately via over-the-air updates

  3. No app store resubmission required

  4. No rebuild in Despia needed

Best Practices

  • Place scanning mode "on" action when displaying QR codes or barcodes

  • Always include an "off" action when users close or navigate away from QR codes

  • Consider using "auto" mode for a hands-off approach that adapts to lighting conditions

  • Test in various lighting environments to ensure optimal performance

Common Use Cases

  • Event ticketing apps with QR code tickets

  • Payment apps displaying QR codes

  • Check-in systems

  • Loyalty card displays

  • Any app requiring reliable QR code or barcode scanning

Need Help?

For additional support or questions, please contact our support team at support@despia.com

Updated on