If you have been advised to remove the advertisingIdentifier or isAdvertisingTrackingEnabled selectors from the Unity SDK, you have two options.
Option 1 - Update to a recent version of Unity
This issue should now be resolved in all supported versions of Unity. Upgrade to one of the following versions or later:
- 2019.3.4+
- 2018.4.19+
- 2017.4.38+
- All versions of 2020.1 and 2020.2
Option 2 - Remove the specific selectors from the XCode project manually
If you are unable to upgrade to a new version of Unity, you can modify the XCode project generated by Unity to make the necessary changes.
- Open the file DeviceSettings.mm within your Xcode project.
- Find and remove the line
#include <AdSupport/ASIdentifierManager.h>
- Find and completely remove the function “QueryASIdentifierManager"
- Find the function "UnityAdvertisingIdentifier" and replace it with:
extern "C" const char* UnityAdvertisingIdentifier()
{
return NULL;
}
5. Find the function “UnityAdvertisingTrackingEnabled” and replace it with:
extern "C" int UnityAdvertisingTrackingEnabled()
{
return 0;
}
Note: The process might vary slightly depending on the version of Unity. There is a walkthrough with similar steps available in the forums.
If you continue to use an older version of Unity, you will need to manually re-apply these edits each time you generate an XCode project. To make these changes permanent for all future builds, update the master template for this file:
On Windows:
<Install Folder>\Editor\Data\PlaybackEngines\iOSSupport\Trampoline\Classes\Unity
On Mac OS:
<Install Folder>/Contents/PlaybackEngines/iPhonePlayer/iPhone-Trampoline/Classes/Unity
If you continue to have issues, contact the Ads Support Team.