On this page
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 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).
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
Show your consent screen first. It explains purposes and vendors and collects the choices the law requires.
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.
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
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_VendorConsentsand more (IAB TCF CMP API).GPP:
IABGPP_HDR_GppStringandIABGPP_GppSID, plus a key per section, for US state privacy choices (IAB GPP CMP API).
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.

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.
// 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:
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
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.
// 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:
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
val tcString = prefs.getString("IABTCF_TCString", null)
val gppString = prefs.getString("IABGPP_HDR_GppString", null)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.
// 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
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 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 covers it step by step.
Platform guides: iOS · Android · Flutter. Native mobile and connected-TV SDKs are included in the Pro plan; see 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.



