Overview
This feature allows users to download and save images from your app directly to their device's camera roll/photo gallery. This is useful for apps that display photos, generate images, or need to save visual content for offline access.
Prerequisites
-
Install the Despia plugin from WeWeb Marketplace
-
Verify installation: Assets → Library → check for "Despia Provider"
Implementation Steps
Step 1: Add Despia Plugin Component
-
Click Add in WeWeb editor
-
Navigate to Assets panel
-
Find Despia Provider → Despia native
-
Drag the Despia plugin to the top of your page
Step 2: Create Download Trigger
-
Add a button element labeled "Download" or similar
-
Can also be triggered from image elements, icons, or any clickable element
Step 3: Configure Download Workflow
-
Select your trigger element
-
Go to Workflows → Add "On click" workflow
-
Add action: Execute component action
-
Component: Despia Plugin
-
Action: "Save to camera roll"
-
URL: Enter image URL (can be static or dynamic)
-
Supported Image Formats
-
JPEG/JPG: Full support
-
PNG: Full support with transparency
-
GIF: Saved as static image
-
WebP: Converted automatically on iOS
-
HEIC: Native support on iOS
User Permissions
iOS
-
First download triggers system permission dialog
-
Users can grant or deny photo library access
-
Check Settings → Privacy → Photos for app permissions
Android
-
Permission requested on first use
-
May vary by Android version
-
Storage permissions required for older Android versions
Publishing & Updates
-
Implementation uses over-the-air updates
-
No app rebuild required
-
Changes deploy immediately to all users
-
No App Store resubmission needed
Best Practices
-
Loading States: Show progress during download
-
Image Optimization: Use appropriate resolutions
-
Batch Downloads: Consider queuing for multiple images
-
Privacy: Only save with user's explicit action
Common Use Cases
E-commerce
-
Save product images for offline viewing
-
Download receipts or invoices
-
Save QR codes for store pickup
Social Media
-
Save shared photos
-
Download user-generated content
-
Export edited images
Educational
-
Save diagrams and charts
-
Download certificates
-
Keep reference materials
Creative Apps
-
Export artwork
-
Save generated images
-
Download templates
Advanced Features
Download with Metadata
Some implementations support saving with metadata:
-
Creation date
-
Location data
-
Description/tags
Format Conversion
Convert formats before saving:
-
Canvas to image
-
SVG to PNG
-
PDF pages to images
Security Considerations
-
CORS: Ensure image URLs allow cross-origin access
-
HTTPS: Use secure URLs when possible
-
Authentication: Handle authenticated image URLs properly
-
Rate Limiting: Implement limits for bulk downloads
Troubleshooting
Image not saving:
-
Check URL is valid and accessible
-
Verify permissions are granted
-
Ensure device has storage space
Permission dialog not appearing:
-
May already be granted/denied
-
Check device settings
-
Reset app permissions if needed
Wrong image saved:
-
Verify URL binding is correct
-
Check for URL encoding issues
-
Test with static URL first
For additional support or questions, please contact our support team at support@despia.com