iOS 14 introduced App Tracking Transparency
To display the App Tracking Transparency authorization request for accessing the IDFA, update your Info.plist to add the NSUserTrackingUsageDescription key with a custom message describing your usage.
The usage description appears as part of the App Tracking Transparency 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")
})
})
}