加日志,在隐藏一次
This commit is contained in:
parent
c89fe09c1a
commit
37e00c0bed
|
@ -233,10 +233,33 @@ 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}");
|
||||
}
|
||||
|
||||
|
||||
TimingRefresh(adUnitId);
|
||||
}
|
||||
}
|
||||
|
@ -365,8 +388,9 @@ namespace WZ
|
|||
{
|
||||
foreach (var key in showingNativeAds.Keys.ToList())
|
||||
{
|
||||
LoggerUtils.Debug($"[Admob] Native ad removing NativeAd {adUnitId}");
|
||||
showingNativeAds[key].NativeOverlayAd.Hide();
|
||||
var ad = showingNativeAds[key].NativeOverlayAd;
|
||||
LoggerUtils.Debug($"[Admob] Native ad removing [showingNativeAds] {adUnitId} , ad {ad.GetResponseInfo()?.GetResponseId()}");
|
||||
ad.Hide();
|
||||
// 从字典中删除元素
|
||||
showingNativeAds.Remove(key);
|
||||
LoadAd(key);
|
||||
|
@ -377,8 +401,9 @@ namespace WZ
|
|||
|
||||
if (showingNativeAds.TryGetValue(adUnitId, out var tempAd))
|
||||
{
|
||||
LoggerUtils.Debug($"[Admob] Native ad removing NativeAd {adUnitId}");
|
||||
tempAd.NativeOverlayAd.Hide();
|
||||
var ad = tempAd.NativeOverlayAd;
|
||||
LoggerUtils.Debug($"[Admob] Native ad removing [showingNativeAds] {adUnitId} , ad {ad.GetResponseInfo()?.GetResponseId()}");
|
||||
ad.Hide();
|
||||
showingNativeAds.Remove(adUnitId);
|
||||
LoadAd(adUnitId);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue