App Tracking Transparency framework

If you want to record the device's ID for Advertisers (IDFA), you must display a prompt in your app to gather the user's consent. To do this, you need to use Apple's App Tracking Transparency (ATT) framework. Once the user has made their choice, the Adjust SDK will store this information. The Adjust SDK will then attach this information to each packet it sends to the Adjust backend.

The Adjust SDK will record the user's decision as one of the following states:

AuthorizedThe user has approved access to app-related data for device tracking.
DeniedThe user has denied access to app-related data for device tracking.
Not determinedThe user has not yet responded to the prompt for access.
RestrictedAccess to app-related data is blocked at the device level.

The Adjust SDK has a built-in wrapper around Apple's tracking authorization method. You can use this wrapper if you do not want to customize the ATT prompt. The Adjust SDK will listen for changes to the authorization status and send it to the Adjust backend.

If you are using your own ATT prompt, you do not need to use the wrapper method. You will need to include the AppTrackingTransparency.framework in your application setup. You can show your prompt either before or after initializing the Adjust SDK. If before, the Adjust SDK will attach the authorization status to the install event. If after, the Adjust SDK will send the authorization status to the backend once it has recorded it.

App-tracking authorization wrapper

The Adjust SDK includes a wrapper built on top of the requestTrackingAuthorizationWithCompletionHandler method. You can use this wrapper to gather information about the user's authorization status. You can also use this method to define callbacks for each response value. When the user interacts with the authorization dialog, they will trigger your callback. The Adjust SDK will also inform the Adjust backend of the user's choice. The callback will return an integer value displaying the authorization status.

[Adjust requestTrackingAuthorizationWithCompletionHandler:^(NSUInteger status) {
    switch (status) {
        case 0:
            // ATTrackingManagerAuthorizationStatusNotDetermined case
        case 1:
            // ATTrackingManagerAuthorizationStatusRestricted case
        case 2:
            // ATTrackingManagerAuthorizationStatusDenied case
        case 3:
            // ATTrackingManagerAuthorizationStatusAuthorized case

Get current authorization status

You can call the appTrackingAuthorizationStatus method to return the current authorization status. The SDK will return an integer value relating to the authorization status.

int authorizationStatus = [Adjust appTrackingAuthorizationStatus];