Overview
Native link handling allows you to control whether links open in Safari, in-app browser tabs, or navigate within your app. This is essential for App Store compliance (payment links must open in Safari) and implementing OAuth flows or deep linking functionality.
Prerequisites
-
Have Despia plugin component on your page (recommended for other native features)
Link Handling Options
Opening Links in Safari (External Browser)
Required for payment processors to comply with App Store rules:
-
In Despia editor, go to In-app link handling
-
Under "Open always in browser", add domains:
-
buy.stripe.com
(for Stripe) -
Your payment processor's domain
-
-
Only add the root domain (not full URLs)
-
Rebuild your application after changes
Opening Links in In-App Browser
Default behavior for most links:
-
In WeWeb, add navigation workflow
-
Set to External link
-
Toggle "Open in new tab" as needed
-
Links open in app's built-in browser
Deep Linking Back to App
Close in-app browser and return to specific app page:
-
Set up deep link scheme:
myapp://
or app linkhttps://myapp.com
-
Use format:
myapp://?link=[destination_url]
- or your app link like:https://myapp.com/[destination_path]
-
Destination can include query parameters (useful for OAuth tokens)
Implementation Steps
Step 1: Configure Payment Links (Safari)
For Stripe or other payment processors:
-
Add button in WeWeb
-
Create workflow → Navigate to
-
Set External link with payment URL
-
In Despia, whitelist payment domain for Safari
Step 2: Configure In-App Browser Links
For OAuth or external content:
-
Add button in WeWeb
-
Create workflow → Navigate to
-
Set External link with target URL
-
Enable "Open in new tab"
Step 3: Implement Return Deep Links
On external page (OAuth callback, etc.):
-
Add return button/redirect
-
Navigate to:
myapp://?link=
https://yourapp.com/success
or:https://myapp.com/success
-
Include any needed parameters in the link
OAuth Implementation
Complete OAuth Flow
-
Initiate: Open OAuth provider in in-app browser
-
Authorize: User completes authentication
-
Callback: Provider redirects to your callback URL
-
Return: Use deep link to return to app with token:
myapp://?link=https://app.com/dashboard&token=xyz123 --- OR --- https://myapp.com/dashboard&token=xyz123
Custom OAuth Providers
Perfect for:
-
Multi-app ecosystems with SSO
-
Custom authentication servers
-
Third-party providers without native SDKs
Despia Configuration
In-App Link Handling Settings
-
Open always in browser: Domains that open in Safari
-
Never open in browser: Force in-app (rarely needed)
-
Always open in app: Default behavior
Deep Link Scheme
Your app's custom URL scheme (e.g., myapp://
) is automatically configured based on your app name.
App Links Scheme
Your apps’ app links and universal links need to be manually configured in WeWeb. Refer to this guide for step-by-step instructions: https://weweb.despia.com/default-guide/global-integrations/applinks
Publishing & Updates
Requires Rebuild
Changes in Despia editor:
-
Link handling rules
-
Whitelisted domains
-
Deep link schemes
Over-the-Air Updates
Changes in WeWeb:
-
Button workflows
-
Navigation logic
-
URL parameters
Common Use Cases
E-commerce
-
Payment processing (Stripe, PayPal)
-
External checkout flows
-
Return to app after purchase
Authentication
-
OAuth providers (Google, Facebook, custom)
-
SSO implementations
-
Multi-app authentication
Content
-
Terms of service (Safari)
-
Help documentation (in-app)
-
External media players
Best Practices
-
Payment Compliance: Always open payment links in Safari
-
User Experience: Minimize app switching
-
Security: Validate tokens and parameters
-
Testing: Test on actual devices, not simulators
-
Fallbacks: Handle cases where deep links fail
Testing Your Implementation
-
Deploy WeWeb changes
-
Rebuild app if Despia settings changed
-
Test payment links open in Safari
-
Test OAuth flow completes properly
-
Verify deep links return to correct page
Troubleshooting
Links not opening in Safari:
-
Verify domain is whitelisted in Despia
-
Check domain format (no https://, just domain)
-
Rebuild app after Despia changes
Deep links not working:
-
Check URL format:
myapp://?link=...
-
Verify app scheme matches
-
Test with simple URLs first
OAuth tokens lost:
-
Include token in deep link parameters
-
Store in secure storage immediately
-
Handle token refresh logic
For additional support or questions, please contact our support team at support@despia.com