Skip to main content

App Tracking Transparency

iOS 14 introduced App Tracking Transparency (ATT). Add NSUserTrackingUsageDescription to Info.plist, then call requestTrackingAuthorization and wait for the callback before loading ads so the SDK can use the IDFA when the user allows tracking.

The usage description appears in the ATT dialog.

<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>

To present the authorization request, call requestTrackingAuthorizationWithCompletionHandler:. We recommend waiting for the completion callback prior to loading ads, so that if the user grants the App Tracking Transparency permission, the Teads inApp SDK can use the IDFA in ad requests.

For more information about the possible status values, see ATTrackingManager.AuthorizationStatus.

import AppTrackingTransparency
import AdSupport
...
func requestIDFA() {
ATTrackingManager.requestTrackingAuthorization(completionHandler: { status in
// Tracking authorization completed. Start loading ads here.
placement?.requestAd(requestSettings: TeadsAdRequestSettings { settings in
settings.pageUrl("https://example.com/article1")
})
})
}