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