Compare commits

..

No commits in common. "a0067d9b5831f81969cf039b6184e51f58373a06" and "5959868867beed52d846d98065f888ff8a8bb31b" have entirely different histories.

1 changed files with 5 additions and 8 deletions

View File

@ -39,7 +39,7 @@ namespace WZ
NativeOverlayAd.Load(adUnitId, new AdRequest(), new NativeAdOptions(), (NativeOverlayAd ad, LoadAdError error) => NativeOverlayAd.Load(adUnitId, new AdRequest(), new NativeAdOptions(), (NativeOverlayAd ad, LoadAdError error) =>
{ {
LoggerUtils.Debug($"[Admob] Native Ad unit {adUnitId} load end. {ad} error {error}"); LoggerUtils.Debug($"[Admob] Native Ad unit {adUnitId} loaded {ad} error {error}");
if (error != null || ad == null) if (error != null || ad == null)
{ {
if (!_retryCounters.TryAdd(adUnitId, 0)) if (!_retryCounters.TryAdd(adUnitId, 0))
@ -55,10 +55,9 @@ namespace WZ
_retryCounters[adUnitId] = 0; _retryCounters[adUnitId] = 0;
var nativeEcpm = AdmobUtils.GetNativeEcpm(ad); LoggerUtils.Debug("Admob Native ad loaded with response : " + ad.GetResponseInfo().ToString());
_nativeAds[adUnitId] = ad; _nativeAds[adUnitId] = ad;
_adRevenueCache[adUnitId] = nativeEcpm; _adRevenueCache[adUnitId] = AdmobUtils.GetNativeEcpm(ad);
LoggerUtils.Debug($"Admob Native ad loaded with nativeEcpm = {nativeEcpm} response : " + ad.GetResponseInfo().ToString());
AdsKeyEvents.Instance.LogAdFPUEvents(AdsType.Native); AdsKeyEvents.Instance.LogAdFPUEvents(AdsType.Native);
ad.OnAdPaid += (AdValue adValue) => ad.OnAdPaid += (AdValue adValue) =>
@ -188,10 +187,9 @@ namespace WZ
{ {
if (adUnitId == null || string.IsNullOrEmpty(adUnitId)) if (adUnitId == null || string.IsNullOrEmpty(adUnitId))
{ {
foreach (var nativeOverlayAd in _nativeAds) foreach (var ad in _nativeAds.Values)
{ {
nativeOverlayAd.Value.Hide(); ad.Hide();
LoadAd(nativeOverlayAd.Key);
} }
return; return;
@ -200,7 +198,6 @@ namespace WZ
if (_nativeAds.TryGetValue(adUnitId, out var tempAd)) if (_nativeAds.TryGetValue(adUnitId, out var tempAd))
{ {
tempAd.Hide(); tempAd.Hide();
LoadAd(adUnitId);
} }
} }
} }