App Tracking Transparency

Hey,
I am just a beginner in the apple development.
I came to realize that my app should work on App Tracking Transparency too.

I understood about editing the info.plist. Is there anything else I have to write in the codes?

Or just writing in info.plist is enough?

Thank you
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

I have the same problem how to fix it? Can you help me???

App Tracking Transparency
 
 
Q