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
-
Install the Despia plugin from WeWeb Marketplace
-
Verify installation: Assets → Library → check for "Despia package"
Installation
-
Navigate to your WeWeb editor
-
Go to Assets Library → Click the book icon
-
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
-
Open the page where you want to implement scanning mode
-
Go to Assets panel
-
Find and add the Despia Native element from the Despia provider
-
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
-
Select your trigger element (e.g., button)
-
Add a new workflow
-
Add action: Execute Component Action
-
Select: Despia Plugin Component
-
Choose: Set Scanning Mode
-
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
-
Show QR Code: Set scanning mode to "on" or "auto"
-
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:
-
Publish your changes in WeWeb
-
Updates apply immediately via over-the-air updates
-
No app store resubmission required
-
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
For additional support or questions, please contact our support team at support@despia.com