Lovable Prompt
Add scanning mode control functionality to my app using the Despia SDK from: https://www.npmjs.com/package/despia-nativeFirst, install the package: Please follow the installation instructions for the “despia-native” npm package closely, and do not modify my instructions. Implementation as mentioned is critical.
npm install despia-nativeThen import it: import despia from 'despia-native'Create a scanning mode control system that uses Despia URLs like: despia(`scanningmode://${mode}`) where mode can be “auto”, “on”, or “off” to control device scanning behavior and automatically adjust screen brightness for optimal scanning conditions.This feature requires native capabilities which will be fully provided by the “despia-native” npm package, no additional native libraries are needed!
Installation
Install the Despia package from NPM:Usage
1. Import the SDK
2. Control Scanning Mode
Define your scanning mode:"auto"- Automatically manages scanning and brightness based on device conditions"on"- Forces scanning to remain active with optimized screen brightness"off"- Disables scanning functionality and restores normal brightness
- Automatically adjusts screen brightness for optimal scanning conditions
- Maintains scanning capabilities even when app is in background
- Intelligently manages battery usage during extended scanning sessions
- Provides enhanced contrast and visibility for barcode/QR code detection
Resources
- NPM Package
- View full NPM documentation for additional configuration options