Consent & Privacy

How the consent gate works on every LinkTrail SDK: what is held until setConsent, what grant and deny send, CMP integration, and the store privacy answers.

Every LinkTrail SDK — iOS, Android, React Native and Flutter — ships the same consent model, because the two wrappers call the native SDKs. This page is the single description of it; the SDK pages link here rather than restating it.

The gate

Consent gating is on by default (requireConsent: true) and is deny-by-default: an unset decision is treated like a denial, never like a grant. While the decision is unset the install is held — nothing leaves the device: no install call, no clipboard read on iOS, no device identifier. The hold is persisted, so a user who answers on a later launch is still attributed.

Important

An app that never calls setConsent gets no deferred link and no attribution. Wire both answers of your consent prompt to setConsent, or pass requireConsent: false if consent is collected elsewhere.

What each state does

Undecided (default)GrantedDenied
Install callHeld — nothing sentSent once, counted and attributedSent once, uncounted, with no device ID
Deferred link (first launch)Does not routeRoutes via onLinkRoutes via onLink — resolved, not recorded
Re-engagement link (app installed)Routes; the open is not recordedRoutes; the open is recordedRoutes; the open is not recorded
Custom events (trackEvent)DroppedSentDropped; anything queued, in flight or being retried is dropped too

Calling setConsent

Call setConsent(true) or setConsent(false) once your consent UI resolves — for both answers. A decision either way releases the held install, and each answer produces exactly one install. Denial is not silence: the uncounted install is what resolves the deferred link, so a user who declines still lands on the screen the link promised.

iOS

Swift
LinkTrail.shared?.setConsent(true)

Android

Kotlin
LinkTrail.shared?.setConsent(true)

React Native

TypeScript
LinkTrail.setConsent(true);

Flutter

Dart
await LinkTrail.setConsent(true);

There is no consent getter on any platform. The native SDKs persist the decision on the device only — it is not backed up, so a restored or new phone starts undecided — and your app is the source of truth: store the choice yourself and replay it with setConsent after configure on every launch, so a user who already answered never sees the prompt twice. Grant also flushes the offline event queue; deny clears it.

A denial also stops work already under way. An event that is in flight or being retried when setConsent(false) runs is dropped, not queued, so it is never sent later with the device ID: each retry checks consent again before it goes out, and the log shows Event '<name>' dropped — consent not granted. The offline queue sends only while consent allows, and stops if consent is withdrawn mid-flush.

Warning

Since iOS and Android 0.1.0, the deferred link is delivered at least once on every platform. It is saved as soon as it resolves and kept until onLink is registered — in that launch or a later one — and dropped after 7 days if no handler ever takes it. On Android setConsent only re-sends the install when autoTrackInstall is on; with it off, call trackInstall() after the decision. Details on the Android SDK page.

If a consent management platform (CMP) or your own flow already governs tracking, opt out of the gate with requireConsent: false. Tracking then runs from configure without waiting for setConsent(true) — but a denial still wins: an explicit setConsent(false) sends one consent: false install with no device ID and drops custom events. The gate exists so that no identifier is sent before the user has answered — switch it off only when something else already guarantees that.

iOS

Swift
LinkTrailOptions(requireConsent: false)

Android

Kotlin
LinkTrailOptions(requireConsent = false)

React Native

TypeScript
await LinkTrail.configure('lt_live_...', { requireConsent: false });

Flutter

Dart
LinkTrailOptions(requireConsent: false)

The iOS paste button

On iOS the deferred click token is read through a paste control, and the user's tap on it counts as the consent act. LinkTrailPasteButton — native, the React Native button (0.1.0 on npm) and the Flutter widget alike — records consent per grantsConsent, then sends the install with the token. The default (omitted) grants only if consent is still undecided, so an earlier setConsent(false) stays; true always grants (an explicit opt-in UI); false never touches consent (under a CMP the install is held with the token until your setConsent). Don't call setConsent or trackInstallWithClickToken from the button's callback. Each SDK page has the snippet.

App Tracking Transparency

The SDK needs no ATT permission: it reads no IDFA and no IDFV, and routing a user needs no advertising identifier. requestTrackingAuthorization() is a convenience for apps that run IDFA-based ad networks alongside LinkTrail; it needs NSUserTrackingUsageDescription in Info.plist or the prompt never appears. Consent for LinkTrail's own tracking is the setConsent decision, not the ATT answer — the SDK does not derive one from the other.

What is sent

With consent granted, the install call carries your app's bundle ID / package name, the platform, the click token when one was recovered, and the SDK's device identifier — on iOS a random, app-scoped per-install UUID (no IDFA, no IDFV); on Android the App Set ID, with a random persisted UUID as fallback. A denied install carries no device identifier and no Idempotency-Key (which is derived from it), on both platforms. Custom events carry the event name, the optional value and currency, and the same device identifier.

Where the SDK keeps its state

Since 0.1.0 the SDK keeps its state (install flags, the consent decision, the device ID, cached attribution, the offline event queue and a saved deferred link) in one file on the device, outside every backup. There is nothing to configure:

PlatformWhereBackups
iOSio.linktrail/state.plist in Application Support, protected until the first unlockExcluded from iCloud and device backups
Androidio.linktrail.state.json in the app's noBackupFilesDirNever copied by Auto Backup or device-to-device transfer; no fullBackupContent or dataExtractionRules needed
  • A restored app or a new phone starts fresh. It counts as a new install with a new device ID, its deferred link is routed again, and the consent answer is gone, so the SDK holds the install again. Show your consent UI whenever you have no answer for this install, not only on the very first launch.
  • Keep your own copy out of backups too. If your app stores the consent answer in backed-up storage, exclude it, or after a restore it will disagree with the SDK.
  • The upgrade moves the old state once. The first launch with 0.1.0 moves the keys from the old store (UserDefaults on iOS, the io.linktrail SharedPreferences file on Android) into the new file. On Android, a fresh install or a restore deletes an old file instead, because it can only have come from a backup.
  • Android: configure the SDK in one process only, normally your main process. The file is not safe across processes.

Store privacy questionnaires

  • App Store Connect → App Privacy. The SDK ships a privacy manifest (PrivacyInfo.xcprivacy) declaring Identifiers → Device ID, linked to the user, not used for tracking, for Analytics and App Functionality; NSPrivacyTracking is false and it lists no tracking domains. Answer the questionnaire the same way.
  • Google Play → Data safety. Declare Device or other IDs (the App Set ID, or the SDK's UUID fallback), collected for Analytics and App functionality. LinkTrail processes it on your behalf.
Note

Processor terms, sub-processors and the full data inventory are in the DPA and the Privacy Policy.