EDIT
I have added the following code to the mainmenu script which loads up when the game starts.
public GameObject GDPR_Popup;
void Start()
{
Invoke("CheckForGDPR",.25f);
}
void CheckForGDPR()
{
if (PlayerPrefs.GetInt("npa", -1) == -1)
{
GDPR_Popup.SetActive(true);
}
}
public void OnUserClickAccept()
{
PlayerPrefs.SetInt("npa", 0); //this is for google admob
AdColonyAppOptions.SetGDPRConsentString("1");
AppLovin.SetHasUserConsent(true);
GDPR_Popup.SetActive(false);
}
public void OnUserClickCancel()
{
PlayerPrefs.SetInt("npa", 1);//this is for google admob
AdColonyAppOptions.SetGDPRConsentString("0");
AppLovin.SetHasUserConsent(false);
GDPR_Popup.SetActive(false);
}
Would something like this work as I'm not sure how to test this?
Also, how to initialize the ad networks only when the user has accepted or canceled GDPR option(this I believe was mentioned in the google admob mediation documents but there was no code sample given).
Can someone please help?