Social Sharing

Enable users to share content from your app using the device's native sharing capabilities, allowing them to send text and URLs to any installed app on their device.

Overview

Native Social Sharing integrates your WeWeb mobile app with the device's built-in share dialog, enabling users to share content through any installed app (WhatsApp, Messages, Email, Social Media, etc.). This feature provides a seamless way for users to spread content, invite friends, or share achievements without leaving your application.

Prerequisites

Before implementing native social sharing, ensure you have:

  1. Installed the Despia plugin from the WeWeb Marketplace

  2. Verified installation by checking AssetsLibrary → look for the book symbol showing "Despia Provider"

Implementation Steps

Step 1: Add the Despia Plugin Component

  1. Click the Add button in your WeWeb editor

  2. Navigate to the Assets panel

  3. Find Despia Provider and Despia native components

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

    • Best practice: Place it as the first element for proper functionality

    • Works on both new and existing pages

Step 2: Add a Share Trigger Element

  1. Add any interactive element (button, icon, link, etc.) that should trigger the share dialog

  2. Select the element and optionally customize its appearance

  3. Consider adding a recognizable share icon for better UX

Step 3: Configure the Share Workflow

  1. With your share element selected, go to Workflows

  2. Add a new workflow with your desired trigger (typically "On click")

  3. Add action: Execute component action

  4. Configure the action:

    • Component: Select "Despia plugin"

    • Action: Choose "Open native social share dialog"

    • Message: Enter the message to share (optional)

    • URL: Enter the link to share (optional)

Share Parameters

Configure what content users can share:

Parameter

Required

Description

Example

message

No

Message or description to share

"Check out this amazing app!"

url

No

Link to share with the message

"https://yourapp.com/invite?ref=user123"

Note: You can use either parameter individually or both together. If both are empty, the share dialog may not function properly.

Dynamic Content Configuration

Make your shared content dynamic by binding parameters to:

  • Variables: User-specific data or app state

  • API responses: Content from your backend

  • Formulas: Computed values or concatenated strings

  • User data: Personalized messages with user names or IDs

Simply click the binding icon next to each parameter and select your data source.

Publishing Changes

  1. Click Publish in WeWeb to deploy your changes

  2. Changes are instantly available via over-the-air updates

  3. No app rebuild or App Store/Google Play resubmission required

  4. Users receive updates immediately without updating the app

  5. Fix issues instantly without waiting for approval processes

Share Dialog Behavior

When triggered, the native share dialog:

  • Displays all compatible apps installed on the user's device

  • Automatically filters apps based on content type (text/URL)

  • Formats content appropriately for each destination app

  • Returns users to your app after sharing or canceling

  • Respects user's system preferences and recent share destinations

Testing

  • Share functionality works only on physical devices (not in browser preview)

  • Test across different social media apps to ensure proper formatting

  • Verify that URLs are clickable in destination apps

  • Check character limits for different platforms (e.g., Twitter/X)

  • Test both iOS and Android as share dialog UI differs

Best Practices

  • Clear messaging: Write concise, engaging share text that explains the value

  • Trackable URLs: Use UTM parameters or custom tracking for analytics

  • Personalization: Include user-specific content when relevant

  • Call-to-action: Add clear CTAs in your share message

  • Fallback handling: Consider what happens if sharing is canceled

  • Visual feedback: Show loading state while share dialog opens

  • Respect frequency: Don't prompt for sharing too often

Common Use Cases

  • Referral programs: Share invite links with referral codes

  • Content sharing: Articles, products, events, or achievements

  • Social proof: Share reviews, testimonials, or success stories

  • Deep linking: Direct users to specific app screens

  • Viral features: Challenges, streaks, or competitive elements

  • Marketing campaigns: Promotional content with tracking

  • Customer support: Share order details or support tickets

Platform Considerations

  • iOS: Uses native UIActivityViewController with full app integration

  • Android: Uses native Intent.ACTION_SEND with system share sheet

  • Share dialog appearance varies by OS version and device manufacturer

  • Some apps may not appear if they don't support the content type

  • Users can customize their share sheet preferences in system settings

Advanced Features

Your app can also implement:

  • Receiving shared content: Accept content shared from other apps (requires additional setup)

  • Custom share extensions: Build specialized sharing experiences

  • Share analytics: Track sharing events and conversion rates

  • A/B testing: Test different share messages for effectiveness

Note: Receiving shared content and custom extensions will be covered in separate documentation.

Troubleshooting

  • Share dialog not appearing: Verify Despia plugin component is on the page

  • Missing apps: Some apps only appear when specific content types are shared

  • Text truncation: Different apps have varying character limits

  • URL not clickable: Ensure URL includes protocol (https://)

Need help?

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

Updated on