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:
State | Meaning |
---|---|
Authorized | The user has approved access to app-related data for device tracking. |
Denied | The user has denied access to app-related data for device tracking. |
Not determined | The user has not yet responded to the prompt for access. |
Restricted | Access 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.
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.
Check for authorization status change
The Adjust SDK automatically reads any change in the user's authorization status from the ATT prompt when you use the ATT wrapper. If you are not using the wrapper, you need to read the status after the user makes their choice. Use the checkForNewAttStatus
method to read the new status and send it to the Adjust backend.
Custom prompt timing
If your app includes an onboarding process or a tutorial, you may want to delay sending your user's ATT consent status until after the user has completed this process. To do this, you can set the attConsentWaitingInterval
property to delay the sending of data for up to 120 seconds to give the user time to complete the initial onboarding. After the timeout ends or the user sets their consent status, the SDK sends all information it has recorded during the delay to Adjust's servers along with the user's consent status.