hi
putting the permission key with text ist only the first step !
A lot of people (me too) have problems because the dialog is not showing up ..only in simulator ..so it seems to be a big bug.
But also you can integrate this function here and call it for example from appdelegate
The code is 100 % correct but not working for me and many others because like mentioned above nothing happens. Its a totally disaster yet.
In AppDelegate
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
put:
requestTrackingPermission()
at the beginning of AppDelegate import this. here:
import AppTrackingTransparency
import AdSupport
and the function:
func requestTrackingPermission() {
if #available(iOS 14, *) {
// ATTrackingManager.requestTrackingAuthorization { status in
ATTrackingManager.requestTrackingAuthorization(completionHandler: { status in
// Load Ads here later
switch status {
case .authorized:
// Tracking authorization dialog was shown
// and we are authorized
print("Authorized")
// Now that we are authorized we can get the IDFA
print(ASIdentifierManager.shared().advertisingIdentifier)
case .denied:
// Tracking authorization dialog was
// shown and permission is denied
print("Denied")
case .notDetermined:
// Tracking authorization dialog has not been shown
print("Not Determined")
case .restricted:
print("Restricted")
@unknown default:
print("Unknown")
}
}
)}
Greets Frank