All ATT handling needs to be managed on the mobile app itself, and not through our SDK, as our SDK is not aware of the lifecycle of the mobile app integrating it. ATT request needs to be displayed and completely handled before our SDK, and the ATT dialog should not be loaded at the same time or on top of our consent layer. Make sure you only load our consent layer via checkAndOpen() or forceOpen() methods after handling the ATT request and making sure the user’s choice regarding ATT was updated on the device already. Do not load our consent layer before that.
All new apps submitted to the App Store must comply with Apple’s App Tracking Transparency (ATT) guidelines for iOS 14.0+. These guidelines enhance user privacy by requiring explicit consent before tracking. This document outlines the necessary steps to implement ATT when using our CMP SDK.
According to Apple’s official documentation:
Calls to the API only prompt when the application state is
UIApplicationState Active
To integrate AppTrackingTransparency.framework, navigate to:
<PROJECT_NAME>.xcproject / <PROJECT_NAME>.xcworkspace -> General -> Frameworks, Libraries, and Embedded Content.
Ensure the framework is correctly embedded to enable ATT functionality.
Include the following key in your Info.plist file:
<key>NSUserTrackingUsageDescription</key>
<string>Your app description explaining why tracking permission is requested.</string>
This message will be displayed to users in the ATT consent prompt.
3. Request Tracking Authorization
To ensure proper consent handling, request ATT permission on the first app launch. This should only occur if the user’s consent status is unknown.
import AppTrackingTransparency
class AppDelegate: UIApplicationDelegate {
// IMPORTANT: this is the proper lifecycle event where the request needs to be done
func applicationDidBecomeActive(_ application: UIApplication) {
if #available(iOS 14, *) {
ATTrackingManager.requestTrackingAuthorization { status in
switch status {
case .authorized:
print("Tracking enabled")
case .denied, .notDetermined, .restricted:
print("Tracking disabled")
}
}
}
}
}
Note: Ensure UI-related logic is executed on the DispatchQueue.main queue, as the completion handler runs on a concurrent queue by default.
4. Monitor Tracking Authorization Status
Use ATTrackingManager.trackingAuthorizationStatus to track consent status changes. The following states are possible:
For consistency, treat restricted as denied unless explicit vendor consent is provided.
If your app uses third-party analytics, update their configuration based on the user’s ATT status:
Example for Firebase:
For apps that do not require advanced analytics, App Store Analytics (accessible via App Store Connect) may provide sufficient insights while ensuring compliance.
if #available(iOS 14.0, *) {
ATTrackingManager.requestTrackingAuthorization { _ in }
}