Journal

App Tracking Transparency Prompt UI in SwiftUI

The ATT prompt is shown once. Earn it with an in-context primer, ask at the right moment, and never punish a no.

App Tracking Transparency Prompt UI in SwiftUI: a glass app tile showing the VP0 logo on a pink and blue gradient

TL;DR

App Tracking Transparency requires a permission prompt before you track a user across apps. Do it well in SwiftUI: show an in-context primer explaining the value first, call the system prompt at a moment that makes sense, and keep every feature working if the user declines. Never gate content on consent, and use Apple's privacy-preserving measurement instead of tracking where you can. Start the UI from a free VP0 design.

App Tracking Transparency is the iOS rule that you must ask permission before tracking a user across other companies’ apps and websites. The catch is that the system prompt can only be shown once, so the difference between a good opt-in rate and a terrible one is entirely in how you set it up. VP0 is the free, AI-readable iOS design library builders start from for the primer screen that earns that yes, so the moment you spend your one prompt actually lands.

Who this is for

You are building an iOS app in SwiftUI, maybe with Cursor or Claude Code, that uses an advertising SDK or otherwise tracks users across apps, and you want to handle the ATT prompt correctly, both for App Review and for real opt-in rates. This is the pattern.

What ATT actually requires

App Tracking Transparency, covered in Apple’s App Tracking Transparency documentation, gates access to the advertising identifier and any cross-app, cross-site tracking behind an explicit user choice. You add a tracking usage description string to Info.plist, then call the request to show the system prompt. Apple’s user privacy and data use guidance is clear about what counts as tracking: linking user or device data collected in your app with data from other companies for advertising or sharing with data brokers. If you only use data inside your own app to run it, you usually do not need the prompt at all.

The primer is the whole game

Because the system prompt appears once and cannot be re-shown if denied, you precede it with your own primer: a plain SwiftUI screen that explains, in one honest sentence, what the user gets if they allow tracking. The primer is not the system dialog, so you can design it, test it, and show it at the right time. Only when the user taps your continue button do you trigger Apple’s prompt. This is the same in-context consent discipline behind a guideline 5.1.1 data collection screen, and it routinely doubles opt-in rates compared with a cold ask on launch.

Time the ask, and respect the answer

Two rules decide whether you pass review and keep users’ trust.

DecisionDoAvoid
When to promptAfter the user sees the valueOn the very first launch
The primerHonest one-line benefitA scary or misleading pitch
On allowUse the identifier as describedTracking beyond what you said
On denyFull app still worksNags, gates, or degraded features

Apple’s App Store Review Guidelines require the app to function whether or not the user consents, so never block content behind tracking. When the answer is no, fall back to privacy-preserving measurement, the same honest posture an HIG accessibility checker brings to compliance. Apple rejected over 375,000 app submissions in 2023 for privacy violations, so getting consent right is review survival, not just good manners.

A worked example: prompting at the right moment

Picture a free game with ads. On first launch you show nothing about tracking; you let the player finish the tutorial and one real level, so they understand the app. Before the first ad break, you present your SwiftUI primer: one line saying that allowing tracking keeps the game free and shows more relevant ads, with a single Continue button. When they tap it, you call the system request and the OS prompt appears. If they allow, you read the advertising identifier and pass it to your ad SDK as described. If they deny, you do absolutely nothing different to the gameplay; the ads simply become non-personalized, and you lean on Apple’s attribution tools to measure campaigns without tracking the individual. The player never sees a nag, never loses a feature, and you spent your single prompt at the one moment it had the best chance of a yes.

Common mistakes and fixes

  • Prompting on first launch. Wait until the user understands the value.
  • Skipping the primer. A primer earns far more opt-ins than a cold ask.
  • Gating content on consent. The app must work fully on a deny.
  • A misleading primer. Apple rejects scare or bait copy; be honest.
  • Forgetting the Info.plist string. Without it the request does nothing.

Once tracking is squared away, getting your build onto a device is the next hurdle, which is exactly testing APNs notifications on the simulator.

Key takeaways

  • ATT gates cross-app tracking and the advertising identifier behind one prompt.
  • Show an in-context primer first; it roughly doubles opt-in rates.
  • The app must work fully whether the user allows or denies.
  • Use privacy-preserving measurement on a deny, from a free VP0 design.

Frequently asked questions

The FAQ above covers implementing the prompt, when to show it, what happens on a deny, and whether you need ATT without ads.

Frequently asked questions

How do I implement the App Tracking Transparency prompt in SwiftUI?

Add the tracking usage description to Info.plist, then call the App Tracking Transparency request at a sensible moment, not on first launch. Show your own in-context primer screen first so the user understands the value, and only then trigger the system prompt, which appears once. Keep every feature working whether they allow or deny, and start the primer UI from a free VP0 design.

When should I show the ATT prompt?

After the user has seen enough of the app to understand why tracking helps them, not on the cold first launch when they have no context. A well-timed primer plus the system prompt at a natural moment earns far more opt-ins than an immediate ask. The system prompt can only be shown once per install, so spend it wisely.

What happens if the user denies tracking?

Your app must keep working fully. You simply cannot access the advertising identifier or track the user across other apps and websites, so fall back to privacy-preserving measurement like Apple's attribution tools. Never degrade features, show nag screens, or block content because someone declined, which violates Apple's rules and erodes trust.

Do I need ATT if I do not show ads?

You need it only if you track the user across apps and websites owned by other companies, or share data with data brokers, regardless of ads. If you only use data within your own app to operate it, you generally do not trigger ATT. When unsure, read Apple's user privacy and data use guidance and default to not tracking.

Part of the Compliance, Localization & Accessibility hub. Browse all VP0 topics →

Keep reading

iOS Guideline 5.1.1 Data Collection UI Template: a glass iPhone UI wireframe icon on a holographic purple gradient
Guides 4 min read

iOS Guideline 5.1.1 Data Collection UI Template

Build a guideline-5.1.1-compliant data collection flow in iOS: in-context permission, clear purpose, and no forced data, from a free VP0 design.

Lawrence Arya · May 31, 2026
Fix Broken Arabic RTL Layouts in AI-Generated iOS Apps: the App Store logo as a glossy glass icon on a purple and blue gradient with floating bubbles
Guides 5 min read

Fix Broken Arabic RTL Layouts in AI-Generated iOS Apps

ChatGPT and Cursor often hardcode left-to-right layouts, so Arabic text looks broken. Here is how to make iOS layouts flip correctly, using a free VP0 design.

Lawrence Arya · May 31, 2026
Check AI-Generated iOS UI Against the Human Interface Guidelines: a glass iPhone app-grid icon on a mint and teal gradient
Guides 4 min read

Check AI-Generated iOS UI Against the Human Interface Guidelines

AI tools generate plausible iOS screens that quietly break Apple's Human Interface Guidelines. Here is a repeatable review pass to catch it, using a free VP0 design.

Lawrence Arya · May 31, 2026
Build a Mental Health Journal App in SwiftUI: a glass app tile showing the VP0 logo on a pink and blue gradient
Guides 4 min read

Build a Mental Health Journal App in SwiftUI

A free SwiftUI pattern for a private mental health journal: mood check-ins, on-device storage, Face ID lock, and HealthKit State of Mind, all non-medical.

Lawrence Arya · June 1, 2026
App Store Privacy Nutrition Label: Fill It Free: a glossy App Store icon on a blue, pink and orange gradient with bubbles
Workflows 5 min read

App Store Privacy Nutrition Label: Fill It Free

Need an App Store privacy nutrition label generator free? You do not need one. Map what your app collects to Apple's labels yourself, accurately, in App Store Connect.

Lawrence Arya · June 1, 2026
iOS Address Autocomplete: Google Places or Free MapKit: a glass photo icon surrounded by chat, music, heart, camera and shopping app icons on a pastel gradient
Guides 4 min read

iOS Address Autocomplete: Google Places or Free MapKit

How to build an address autocomplete UI for iOS with the Google Places API, plus MKLocalSearchCompleter, the free native alternative built into MapKit.

Lawrence Arya · June 2, 2026