Save to Camera Roll

Save images directly to the device's photo gallery from your WeWeb application.

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

  1. Install the Despia plugin from WeWeb Marketplace

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

Implementation Steps

Step 1: Add Despia Plugin Component

  1. Click Add in WeWeb editor

  2. Navigate to Assets panel

  3. Find Despia ProviderDespia native

  4. Drag the Despia plugin to the top of your page

Step 2: Create Download Trigger

  1. Add a button element labeled "Download" or similar

  2. Can also be triggered from image elements, icons, or any clickable element

Step 3: Configure Download Workflow

  1. Select your trigger element

  2. Go to Workflows → Add "On click" workflow

  3. 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

  1. Loading States: Show progress during download

  2. Image Optimization: Use appropriate resolutions

  3. Batch Downloads: Consider queuing for multiple images

  4. 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

Need Help?

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

Updated on