iOS Identity for Advertisers (IDFA) Authorization Pop-up
Overview
For devices with iOS v14.5 and above, getting Identity for Advertisers (IDFA) requires user consent as Apple increases the transparency of operations related to user privacy.
The game team shall use the AppTrackingTransparency framework to obtain the IDFA with a pop-up. If the AppTrackingTransparency framework is not integrated, there is a risk in the App Review process. For more information, see User Privacy and Data Use.
The ATT policy has been adopted since the release of iOS 14.5. For systems from iOS 14.0 to iOS 14.4, the IDFA can still be obtained even when the user does not give their consent through the pop-up.
Add Pop-Up Authorization
If the game team needs to perform authorized collection, call the following API. This API implements pop-up authorization to obtain the IDFA:
static void RequestTrackingAuthorization();
- This API is for iOS only. To make it take effect, compile it with Xcode 12 or later versions and run it in 14.5 or later system versions.
- Add the referenced iOS library:
AppTrackingTransparency.framework
. Add theNSUserTrackingUsageDescription
configuration and descriptive texts to display in the authorization pop-up to theInfo.plist
file. For more information, see the iOS usage description for Unity or Unreal Engine SDK. - This API sends quests only once. The system will remember the user's choice and will no longer prompt unless the user uninstalls and reinstalls the app on the device.
IDFAs for iOS platforms are collected by default. To disable the collection, add the following configuration to APASConfig.ini
:
DEVICE_INFO_SWITCHES={"ios_idfa":false}
"ios_idfa":false
: Disable iOS IDFA collection
To enable collection for a certain ID, change the corresponding configuration to true
.
Integrate AppTrackingTransparency Framework
The game team can also manually integrate the AppTrackingTransparency framework to perform pop-up authorization.
According to the Apple App Tracking Transparency instructions, the ATT framework integration process contains three steps:
info.plist
sets the permission request text.- The client pop-up requests for player permission.
- Call the API to get IDFAs based on user consent.