# Consent management SDK for iOS and Android: ATT, GDPR, TCF

**Source:** https://cookiepanda.app/blog/mobile-app-consent-att-gdpr-tcf  
**Summary:** In which order to show Apple's ATT prompt and your consent screen, how TCF and GPP strings reach ad SDKs, and code for iOS, Android and Flutter.  
**Published:** 2026-11-19  
**Publisher:** Cookie Panda

---

## Key takeaways

ATT and GDPR consent answer different questions, and an app usually needs both.

- Apple's ATT prompt is required on iOS 14.5 and later before you track users or read the advertising identifier.
- GDPR consent is still needed in Europe, whatever the ATT answer.
- Show your consent screen first, and only show ATT if the user agreed to the relevant purposes.
- In-app TCF and GPP strings live in standard IABTCF\_ and IABGPP\_ keys that ad SDKs read directly.

On the web, consent is one banner. In an app it is often three things at once: Apple's App Tracking Transparency (ATT) prompt, a GDPR consent screen for users in Europe, and the IAB TCF strings your ad SDKs expect. Get the order wrong and you either annoy users with two prompts that contradict each other, or track someone who said no.

This guide explains how the pieces fit, the order that works, and the code for iOS, Android and Flutter.

## ATT and GDPR consent are different questions {#att-and-gdpr-consent-are-different-questions}

- **ATT** is Apple's rule. On iOS, iPadOS and tvOS 14.5 or later, you need the user's permission through the ATT framework to track them across other companies' apps and websites, or to access the device's advertising identifier ([Apple](https://developer.apple.com/app-store/user-privacy-and-data-use/)).
- **GDPR and ePrivacy consent** is the law in Europe. It covers storing or reading information on the device and processing personal data for purposes like analytics and advertising, on every platform.

A yes to ATT is not GDPR consent, and GDPR consent does not replace ATT. Apple also says your app must always respect the user's ATT response, even if their answer to another prompt conflicts with it. So a European iOS user who allows tracking in ATT but declines advertising in your consent screen must not be tracked, and one who accepts advertising in your consent screen but declines ATT must not be tracked across apps either.

## The order that works {#the-order-that-works}

1. **Show your consent screen first.** It explains purposes and vendors and collects the choices the law requires.
2. **Show ATT only if it can matter.** Apple says you should not send users to the ATT prompt if they have opted out of all relevant legal consent choices. If the user rejected advertising, skip ATT entirely.
3. **Respect both answers.** Track only when both allow it.

A short explanation screen before the system prompt is allowed as long as you are transparent. What Apple does not allow is manipulating or forcing people to consent, gating features behind tracking, or offering rewards for allowing it (App Review Guidelines 5.1.1 and 5.1.2).

Android has no system tracking prompt like ATT. Apps targeting Android 13 or later must declare the `com.google.android.gms.permission.AD_ID` permission to use the advertising ID, and users can delete their ID in system settings, after which apps receive a string of zeros. Your consent screen is the main control.

## How consent reaches your ad SDKs {#how-consent-reaches-your-ad-sdks}

In apps, the IAB standards use the platform's key-value storage instead of a JavaScript API. A CMP writes the results to `NSUserDefaults` on iOS and the default `SharedPreferences` on Android, and TCF-aware SDKs read them without any extra code from you:

- **TCF:** `IABTCF_TCString`, `IABTCF_gdprApplies`, `IABTCF_PurposeConsents`, `IABTCF_VendorConsents` and more ([IAB TCF CMP API](https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20CMP%20API%20v2.md)).
- **GPP:** `IABGPP_HDR_GppString` and `IABGPP_GppSID`, plus a key per section, for US state privacy choices ([IAB GPP CMP API](https://github.com/InteractiveAdvertisingBureau/Global-Privacy-Platform/blob/main/Core/CMP%20API%20Specification.md)).

Cookie Panda's iOS, Android and Flutter SDKs write these standard keys, unprefixed, so the ad and analytics SDKs in your app find them where they expect. Cookie Panda is a registered IAB TCF v2.3 CMP (ID 515), and its GPP support is [tested against IAB-generated vectors on every SDK](page:/blog/gpp-support-in-every-sdk).

Show your consent screen first, and the ATT prompt only when it can matter.

## iOS {#ios}

Add the Swift package and start the SDK at launch. It shows a native consent sheet and is IFA/LAT-aware: it reads the ATT status before exposing the advertising ID.

```swift
// Package.swift
.package(url: "https://github.com/cookiepanda/cookiepanda-ios", from: "1.0.0")

// AppDelegate.swift
import CookiePanda

CookiePanda.start(token: "cp_xxx")
```

Once the consent flow has finished, decide whether ATT can matter. TCF Purpose 1 (store and access information on a device) is the first character of `IABTCF_PurposeConsents`. Add an `NSUserTrackingUsageDescription` string to your Info.plist, then:

```swift
import AppTrackingTransparency

func requestTrackingIfConsented() {
  let defaults = UserDefaults.standard
  let gdprApplies = defaults.integer(forKey: "IABTCF_gdprApplies") == 1
  let purposes = defaults.string(forKey: "IABTCF_PurposeConsents") ?? ""
  let storageConsent = purposes.first == "1"

  // In GDPR regions, skip ATT if the user declined device storage
  if gdprApplies && !storageConsent { return }

  ATTrackingManager.requestTrackingAuthorization { status in
    // Track only if status == .authorized AND consent allows it
  }
}
```

## Android {#android}

Add the Gradle dependency and start the SDK in your Application class. It presents a native Jetpack Compose consent flow and writes the standard keys to SharedPreferences.

```kotlin
// build.gradle.kts
implementation("app.cookiepanda:sdk:1.0.0")

// Application.kt
import app.cookiepanda.CookiePanda

CookiePanda.start(context, "cp_xxx")
```

Any part of your app can read the result the same way your ad SDKs do:

```kotlin
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
val tcString = prefs.getString("IABTCF_TCString", null)
val gppString = prefs.getString("IABGPP_HDR_GppString", null)
```

## Flutter {#flutter}

One package covers both stores. It writes the TCF keys natively on each platform, so your ad and Firebase plugins read them as if you had used the native SDKs.

```dart
// flutter pub add cookie_panda
import 'package:cookie_panda/cookie_panda.dart';

CookiePanda.start(token: 'cp_xxx');
```

On iOS, run the same ATT logic in native Swift, or through a Flutter plugin for ATT, after the consent flow.

## One consent record across web, app and TV {#one-consent-record-across-web-app-and-tv}

Users do not think of your website, app and TV app as separate products, and auditors will not either. Cookie Panda's web, mobile and connected-TV SDKs share one consent record, and every choice on every platform is stored as a [signed consent receipt](page:/features/consent) in the same dashboard. Google Consent Mode v2 signals are shared with your Firebase and Google Ads SDKs too. If you are setting up the web side, our [Consent Mode v2 guide for GTM](page:/blog/google-consent-mode-v2-gtm-setup) covers it step by step.

Platform guides: [iOS](page:/platforms/ios) · [Android](page:/platforms/android) · [Flutter](page:/platforms/flutter). Native mobile and connected-TV SDKs are included in the Pro plan; see [pricing](page:/pricing).

## Ship one consent flow on every platform

Native iOS, Android and Flutter SDKs with IAB TCF v2.3 and GPP keys, IFA/LAT-aware consent and one shared record.

Native mobile and CTV SDKs are on the Pro plan.
