appsflyer:// scheme.
Enable AppsFlyer for your app and add your AppsFlyer Dev Key (plus your Apple App ID on iOS) to your project configuration, then rebuild. No data flows until the SDK is enabled and the app is rebuilt.
Installation
- Bundle
- CDN
How it works
Despia activates the native AppsFlyer SDK at app launch and starts a new session every time the app returns to the foreground. Attribution data is resolved natively, cached on the device, and injected into your web layer on every page load, with no setup, no requests, and no waiting:despia("appsflyer://...") are intercepted natively and forwarded to AppsFlyer in real time. AppsFlyer then postbacks to your connected partners (Meta, TikTok, Google) based on your dashboard configuration. Emails and phone numbers are hashed with SHA256 on the device before transmission, so raw PII never leaves the app.
When a user arrives through a OneLink, an ad click or a creator’s affiliate link, the native layer resolves it and delivers the click’s metadata (the product, creator, invite code, or offer you attached to the link) to your web app through the window.onAppsFlyerDeepLink callback. This works even for a brand-new user who installs from the store first: AppsFlyer stores the click server-side and delivers it on that first launch (deferred deep linking). Your app reads the payload and decides what to do with it, redirect, fetch, or render the right content in place. Put anything a fresh install must receive into deep_link_sub1 through deep_link_sub10, the fields AppsFlyer guarantees on deferred resolution.
On iOS, the AppsFlyer SDK waits up to 60 seconds for the App Tracking Transparency prompt to be answered before finalizing install attribution. This is handled automatically.
Feature map
Attribution
Read where every user came from, TikTok, Meta, Google, affiliate, or organic, through injected variables.
Deep Linking
Receive OneLink payloads (direct and deferred) through a callback and open the right content in your app.
Events
Log standard and custom in-app events back to AppsFlyer, Meta, and TikTok.
Campaigns
Connect Meta and TikTok as integrated partners and measure which campaigns drive the most valuable users.
Ad Revenue
Report impression-level ad revenue per network for LTV and ROAS reporting.
User Identity
Set your customer user ID, pass hashed email and phone, and read the AppsFlyer UID.
Consent
Forward GDPR and DMA consent choices from your cookie banner to the native SDK.
Testing
Verify installs, events, and user IDs end to end before going live.
Quick start
Enable AppsFlyer for your app
Add your AppsFlyer Dev Key (and Apple App ID on iOS) to your project configuration and rebuild. The SDK, session tracking, and attribution injection activate automatically.
Resources
NPM Package
despia-native