Compare commits

..

No commits in common. "7e7f3a02349391fd983da2ab58cb8f9f98359685" and "df5dccc8cf9f186c22d2871db8fb119b5c453b4b" have entirely different histories.

1 changed files with 6 additions and 31 deletions

View File

@ -233,33 +233,10 @@ namespace WZ
// and anchored to the bottom of the screne.
ad.RenderTemplate(style, new AdSize(position.Width, position.Height), position.X, position.Y);
var showNativePosition = showingNativeAds[adUnitId];
var lastAdResponseId = lastAd?.GetResponseInfo()?.GetResponseId();
var lastShowAdResponseId = lastShowAd?.GetResponseInfo()?.GetResponseId();
var lastShowAdResponseId2 = showNativePosition?.NativeOverlayAd?.GetResponseInfo()?.GetResponseId();
var showAdResponseId = ad.GetResponseInfo()?.GetResponseId();
LoggerUtils.Debug(
$"[Admob] Native ad ShowAd [showingNativeAds] {adUnitId} , lastAdResponseId = {lastAdResponseId} , lastShowAdResponseId = {lastShowAdResponseId} , lastShowAdResponseId2 = {lastShowAdResponseId2} , showAdResponseId = {showAdResponseId}");
showingNativeAds[adUnitId] = new ShowNativePosition(ad, position);
ad.Show();
try
{
lastAd?.Hide();
lastShowAd?.Hide();
showNativePosition?.NativeOverlayAd?.Hide();
}
catch (Exception e)
{
LoggerUtils.Error($"[Admob] Native ad Hide fail {adUnitId} , e : {e.Message}");
}
lastAd?.Hide();
lastShowAd?.Hide();
TimingRefresh(adUnitId);
}
}
@ -388,9 +365,8 @@ namespace WZ
{
foreach (var key in showingNativeAds.Keys.ToList())
{
var ad = showingNativeAds[key].NativeOverlayAd;
LoggerUtils.Debug($"[Admob] Native ad removing [showingNativeAds] {adUnitId} , ad {ad.GetResponseInfo()?.GetResponseId()}");
ad.Hide();
LoggerUtils.Debug($"[Admob] Native ad removing NativeAd {adUnitId}");
showingNativeAds[key].NativeOverlayAd.Hide();
// 从字典中删除元素
showingNativeAds.Remove(key);
LoadAd(key);
@ -401,9 +377,8 @@ namespace WZ
if (showingNativeAds.TryGetValue(adUnitId, out var tempAd))
{
var ad = tempAd.NativeOverlayAd;
LoggerUtils.Debug($"[Admob] Native ad removing [showingNativeAds] {adUnitId} , ad {ad.GetResponseInfo()?.GetResponseId()}");
ad.Hide();
LoggerUtils.Debug($"[Admob] Native ad removing NativeAd {adUnitId}");
tempAd.NativeOverlayAd.Hide();
showingNativeAds.Remove(adUnitId);
LoadAd(adUnitId);
}