#if CRAZY_FRUIT_ADMOB
using System;
using GoogleMobileAds.Ump.Api;
using UnityEngine;
/// UMP consent gate before the Mobile Ads SDK may load ads (EEA / UK / CH).
public static class AdMobConsentBridge
{
public static void RunConsentGate(Action onComplete)
{
var request = new ConsentRequestParameters();
ConsentInformation.Update(request, updateError =>
{
if (updateError != null)
{
Debug.LogWarning("[AdMob] Consent update failed: " + updateError.Message);
onComplete?.Invoke(ConsentInformation.CanRequestAds());
return;
}
ConsentForm.LoadAndShowConsentFormIfRequired(showError =>
{
if (showError != null)
Debug.LogWarning("[AdMob] Consent form: " + showError.Message);
onComplete?.Invoke(ConsentInformation.CanRequestAds());
});
});
}
}
#endif