# Prepare tvOS versions

This guide outlines the changes needed to prepare your app for
tvOS 14.

## Prerequisites

- Interactive Media Ads SDK 4.3.2 or higher.

## Request App Tracking Transparency authorization

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. Here is an example description
text:

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

![](https://developers.google.com/static/admob/images/idfa/editor.png)

The usage description appears in the App Tracking Transparency dialog box:
![](https://developers.google.com/static/admob/images/idfa/att-tvOS.png)

To present the authorization request, call
[`requestTrackingAuthorizationWithCompletionHandler:`](https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547037-requesttrackingauthorization).
We recommend waiting for the completion callback prior to loading ads so that if
the user grants the App Tracking Transparency permission, the Interactive Media
Ads SDK can use the IDFA in ad requests.

### Swift

```swift
import AppTrackingTransparency
import AdSupport
...
func requestIDFA() {
  ATTrackingManager.requestTrackingAuthorization(completionHandler: { status in
    // Tracking authorization completed. Start loading ads here.
    // loadAd()
  })
}
```

### Objective-C

```objective-c
#import <AppTrackingTransparency/AppTrackingTransparency.h>
#import <AdSupport/AdSupport.h>
...
- (void)requestIDFA {
  [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
    // Tracking authorization completed. Start loading ads here.
    // [self loadAd];
  }];
}
```

For more information about the possible status values, see
[`ATTrackingManager.AuthorizationStatus`](https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/authorizationstatus).

> [!IMPORTANT]
> **Key Point:** For a better user experience, we recommend adding an explainer preceding the call to `requestTrackingAuthorizationWithCompletionHandler:` to clarify the permission and data usage to users.

## Publisher first-party ID, formerly known as same app key

> [!NOTE]
> **Note:** Same app key has been renamed to [Publisher first-party
> ID](https://support.google.com/admob/answer/9997589). The same app key API may change to reflect publisher first-party ID in an upcoming SDK release. This change will not impact existing activation of same app key on IMA SDKs 3.14.5+. All applicable SDK versions will process the identifier seamlessly.

**Prerequisites: IMA SDK for iOS 3.14.5 or higher**

The Interactive Media Ads SDK for iOS introduced Publisher first-party
ID, formerly known as [same app
key](https://support.google.com/admanager/answer/9997589) to help you deliver more
relevant and personalized ads by using data collected from your apps.

Publisher first-party ID is enabled by default, but you can always choose to
disable it in your app by setting
[`IMASettings::SameAppKeyEnabled`](https://developers.google.com/interactive-media-ads/docs/sdks/ios/client-side/reference/Classes/IMASettings#sameappkeyenabled) to `false`:

### Swift

```swift
let settings = IMASettings()
// Disables Publisher first-party ID, formerly known as same app key.
settings.SameAppKeyEnabled = false
adsLoader = IMAAdsLoader(settings: settings)
```

### Objective-C

```objective-c
IMASettings *settings = [[IMASettings alloc] init];
// Disables Publisher first-party ID, formerly known as same app key.
settings.SameAppKeyEnabled = false;
IMAAdsLoader *adsLoader = [[IMAAdsLoader alloc] initWithSettings:settings];
```

## Disclose data usage in the App Store

Apple requires that developers publishing apps on the App Store disclose
[certain information](https://developer.apple.com/app-store/app-privacy-details/)
regarding their apps' data use. Apple has
[announced](https://developer.apple.com/news/?id=vlj9jty9) that these disclosures will
be required for new apps and app updates starting December 8, 2020.

[Learn more about the data disclosure
requirements](https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/tvos/data-disclosure).