Skip to main content
Forward the user’s cookie-banner choice to the AppsFlyer SDK’s consent API for DMA compliance. The values control how AppsFlyer processes the user’s data and shares it with ad partners.

Installation

npm install despia-native
pnpm add despia-native
yarn add despia-native
import despia from 'despia-native';

despia("appsflyer://set_consent?is_gdpr=true&has_consent=true")
is_gdpr
boolean
required
Whether the user is subject to GDPR (EU, EEA, and UK users).
The user’s choice from your consent banner. On iOS this single flag drives both AppsFlyer consent dimensions: data usage and ads personalization.

When to call it

1

On every launch, as soon as the choice is known

Consent applies to the current SDK session. If you already have a stored choice, forward it immediately on page load, otherwise forward it the moment the user answers your banner.
2

Before identity and events

Send consent before set_user_id, set_email, set_phone, and any log_event calls so nothing is processed against the user’s choice.
3

Again whenever the user changes their mind

If the user updates their preference in your settings screen, call set_consent again with the new values.

iOS: App Tracking Transparency

Consent and ATT are separate layers, and Despia handles the second one for you. On iOS the AppsFlyer SDK waits up to 60 seconds for the user to answer the ATT prompt before finalizing install attribution. If the user denies ATT, AppsFlyer operates without the IDFA regardless of what you pass in set_consent.
set_consent is about privacy regulation (GDPR and DMA). ATT is about the device identifier. You need both to be in order. Despia manages the ATT flow natively, your web layer only supplies set_consent.

Resources

NPM Package

despia-native