I am implementing IronSource Facebook Audience Network mediation for a Unity game. In the docs it mentions setting SetAdvertiserTrackingEnabled
in step 9. Sorry if this sounds stupid, but how do I do this if I'm using IronSource mediation and not the actual Audience Network SDK? Am I missing something here?
Ironsource integration doc: https://developers.ironsrc.com/ironsource-mobile/unity/facebook-mediation-guide/#step-9
I am not really familiar with Objective-C but I did it according to FAN recommendations and added a C# script
using UnityEngine;
using System.Runtime.InteropServices;
#if UNITY_IOS
namespace AudienceNetwork
{
public static class AdSettings
{
[DllImport("__Internal")]
private static extern void FBAdSettingsBridgeSetAdvertiserTrackingEnabled(bool advertiserTrackingEnabled);
public static void SetAdvertiserTrackingEnabled(bool advertiserTrackingEnabled)
{
FBAdSettingsBridgeSetAdvertiserTrackingEnabled(advertiserTrackingEnabled);
}
}
}
#endif
So after I can set the FAN flag with simple:
AudienceNetwork.AdSettings.SetAdvertiserTrackingEnabled(true);
With iOS Support Package, I did also a simple script to set it according to current IDFA/ATT settings in iOS Preferences (user can change it anytime).
using Unity.Advertisement.IosSupport;
public void iOS_SetFanFlag()
{
bool setFanFlag;
if ((int)ATTrackingStatusBinding.GetAuthorizationTrackingStatus() == 3)
setFanFlag = true; //If==3, App is AUTHORIZED in settings
else setFanFlag = false; //DENIED, RESTRICTED or NOT DETERMINED (==2,1,0)
AudienceNetwork.AdSettings.SetAdvertiserTrackingEnabled(setFanFlag);
}
Case is - this has to be set BEFORE initialization of IronSource and I am not sure how to check/test if it works correctly.