| 1234567891011121314151617181920212223242526272829303132 |
- #if CRAZY_FRUIT_ADMOB
- using System;
- using GoogleMobileAds.Ump.Api;
- using UnityEngine;
- /// <summary>UMP consent gate before the Mobile Ads SDK may load ads (EEA / UK / CH).</summary>
- public static class AdMobConsentBridge
- {
- public static void RunConsentGate(Action<bool> 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
|