Overview
The Device ID feature allows you to retrieve a unique identifier for each mobile device running your WeWeb application through Despia. This is particularly useful for:
-
Linking devices to user accounts
-
Preventing account sharing
-
Managing free plan limitations
-
Tracking device-specific analytics
Prerequisites
Before you begin, ensure you have the Despia plugin installed in your WeWeb project:
-
Go to the WeWeb Marketplace
-
Search for and install the Despia plugin
-
Verify installation by checking Assets → Library → look for the book symbol showing "Despia provider" library
Implementation Steps
Step 1: Add the Despia Plugin to Your Page
-
Click the Add button in your WeWeb editor
-
Navigate to the Assets panel (switch from Basics to Assets)
-
Find Despia provider and Despia native components
-
Drag the Despia plugin element onto your page
-
Release it anywhere on the page (it provides native functionalities without visible UI)
Step 2: Access the Device ID Variable
-
Add any element where you want to display or use the device ID (e.g., a Text element)
-
Select the element and make its content dynamic
-
Open the Variables panel
-
Navigate to Despia plugin variables section
-
Select Despia plugin device id
The variable path will be: Despia plugin > device id
Step 3: Use the Device ID
You can use the device ID variable in multiple ways:
-
Display: Show it in a text element for debugging
-
Backend Integration: Send it with API requests to link devices with user accounts
-
Conditional Logic: Use it in workflows for device-specific features
Testing
-
In Browser: The device ID will display as "example device id" when testing in the WeWeb editor
-
On Device: The actual unique device ID will appear when running the app through Despia on a real mobile device
Publishing Changes
-
Click Publish in WeWeb to deploy to your subdomain or primary domain
-
Changes are automatically available in your mobile app via over-the-air updates
-
No app rebuild or App Store resubmission required
Important Notes
-
The device ID is persistent and unique to each physical device session
-
The ID remains the same even after app reinstalls (on iOS, it may change after a factory reset)
-
Over-the-air updates mean any changes to Despia plugin configurations are instantly reflected in your live app without rebuilding
-
This feature is fully compliant with App Store and Google Play guidelines
Common Use Cases
-
Account Security: Limit the number of devices per user account
-
Analytics: Track user behavior across specific devices
-
Free Plan Management: Restrict free tier access to a certain number of devices
-
Device-Specific Settings: Store preferences per device rather than per account
For additional support or questions, please contact our support team at support@despia.com