Support for iOS 14
Starting January 2021, Apple restricts access to IDFA on iOS 14. This means that Apple will no longer provide IDFA by default. IDFA (Identifier for Advertisers) is a unique device ID that is used for ad attribution and retargeting.
The Yandex Mobile Ads SDK uses IDFA to maximize publisher revenue by displaying more relevant ads.
To receive the IDFA, the app developer must now explicitly ask for the user's permission. You can do this using the AppTrackingTransparency framework.
It works similar to requests for sending push notifications.
Requesting permission to access IDFA
When starting the app, check the permission status using the trackingAuthorizationStatus property. Further recommendations depend on whether the user disabled access to the IDFA.
The user didn't disable access to the IDFA
The app can show the user an IDFA access permission request only once, so it's important to convince the user to grant the permission.
Strategy for working with users:
-
Before showing a system dialog, display a dialog box explaining:
- What exactly is requested.
- How it will be used.
- Why the user should allow access.
You can add on-screen buttons like Allow and Not Now.
Note
If the user agrees to grant permission in the app's dialog box with the explanation, it's highly likely that they will give consent in the system dialog. If the user refuses to grant permission in the dialog box with explanations, you'll be able to display this dialog box again.
Sample dialog box with explanations
-
Request access to the IDFA via App Tracking Transparency.
The user disabled access to the IDFA
The user may have refused to grant permission to the IDFA in the system dialog.
Strategy for working with users:
-
In the app, display a dialog box explaining:
- What exactly is requested.
- How it will be used.
- Why the user should allow access.
You can add on-screen buttons like Allow and Not Now.
Sample dialog box with explanations
-
Redirect the user to the settings via UIApplication.openSettingsUrlString.
Sample user settings with access disabled
Requesting permission to access the IDFA via App Tracking Transparency
In iOS 14, use a new framework named App Tracking Transparency to show the system dialog in your app. The user will choose to allow or deny access to IDFA in it.
Note
This system dialog can only be displayed once each time the app is installed. If the user selects Ask App Not to Track, you won't be able to show the dialog for this app again.
-
You can't change the system dialog, but you can add text with explanations to it. To do this, add the
NSUserTrackingUsageDescription
key to Info.plist. For example:<key>NSUserTrackingUsageDescription</key> <string>This identifier will be used to deliver personalized ads to you.</string>
Text from Info.plist will be shown to the user in the system dialog. In the text, explain to the user why the app requests permission to use the IDFA.
-
To display a dialog box requesting permission to access the IDFA, call the requestTrackingAuthorization(completionHandler:) method.
Sample system dialog box
-
Before loading ads, wait until a callback is received. The Yandex Mobile Ads SDK will then be able to use the IDFA in requests for ads.
import AppTrackingTransparency // ... func requestTrackingAuthorization() { ATTrackingManager.requestTrackingAuthorization { status in // Start ad loading } }
-
To check the App Tracking Transparency authorization status, use the trackingAuthorizationStatus property.
Read more about App Tracking Transparency in the Apple documentation.