title: How to add the AppTrackingTransparency permission to your iOS apps
body: <p>I am extremely new to iOS, with no iOS development experience at all, however, I've been given a task that's related to <code>preparing for iOS 14+</code>. Based on what I've found <a href="https://support.google.com/admanager/answer/9997589" rel="noreferrer">https://support.google.com/admanager/answer/9997589</a>, to ensure there's no loss in revenue, I need to do 2 things.</p>
  <ol>
  <li>Install the latest Google Mobile Ads SDK for iOS (version 7.64 or later) for AdMob or Ad Manager</li>
  <li>Add the AppTrackingTransparency permission to your iOS apps.</li>
  </ol>
  <p>I've followed some guides and I'm at the point of dealing with adding the <code>AppTrackingTransparency permission</code> to the iOS app. This is the guide that I'm using, <a href="https://developers.google.com/admob/ios/ios14#swift" rel="noreferrer">https://developers.google.com/admob/ios/ios14#swift</a>.</p>
  <p>I managed to add the key/value, shown below, in <code>Info.plist</code></p>
  <pre><code>&lt;key&gt;NSUserTrackingUsageDescription&lt;/key&gt;
  &lt;string&gt;This identifier will be used to deliver personalized ads to you.&lt;/string&gt;
  </code></pre>
  <p>But this is where I'm hoping to get some help. I think that I still need to add code somewhere to request user permission with AppTrackingTransparency. Based on the guide I think the following code is required to show the <code>App Tracking Transparency dialog box</code>. <code>Question 1</code>, is my assumption correct?</p>
  <pre><code>import AppTrackingTransparency
  import AdSupport
  ...
  func requestIDFA() {
    ATTrackingManager.requestTrackingAuthorization(completionHandler: { status in
      // Tracking authorization completed. Start loading ads here.
      // loadAd()
    })
  }
  </code></pre>
  <p><code>Question 2</code>, does the code live in <code>AppDelegate.swift</code>? Or is it really just somewhere that's suitable in the codebase? Thanks.</p>