Compare commits
No commits in common. "7e7f3a02349391fd983da2ab58cb8f9f98359685" and "df5dccc8cf9f186c22d2871db8fb119b5c453b4b" have entirely different histories.
7e7f3a0234
...
df5dccc8cf
|
|
@ -233,33 +233,10 @@ namespace WZ
|
||||||
// and anchored to the bottom of the screne.
|
// and anchored to the bottom of the screne.
|
||||||
ad.RenderTemplate(style, new AdSize(position.Width, position.Height), position.X, position.Y);
|
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);
|
showingNativeAds[adUnitId] = new ShowNativePosition(ad, position);
|
||||||
ad.Show();
|
ad.Show();
|
||||||
|
lastAd?.Hide();
|
||||||
try
|
lastShowAd?.Hide();
|
||||||
{
|
|
||||||
lastAd?.Hide();
|
|
||||||
lastShowAd?.Hide();
|
|
||||||
showNativePosition?.NativeOverlayAd?.Hide();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
LoggerUtils.Error($"[Admob] Native ad Hide fail {adUnitId} , e : {e.Message}");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
TimingRefresh(adUnitId);
|
TimingRefresh(adUnitId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -388,9 +365,8 @@ namespace WZ
|
||||||
{
|
{
|
||||||
foreach (var key in showingNativeAds.Keys.ToList())
|
foreach (var key in showingNativeAds.Keys.ToList())
|
||||||
{
|
{
|
||||||
var ad = showingNativeAds[key].NativeOverlayAd;
|
LoggerUtils.Debug($"[Admob] Native ad removing NativeAd {adUnitId}");
|
||||||
LoggerUtils.Debug($"[Admob] Native ad removing [showingNativeAds] {adUnitId} , ad {ad.GetResponseInfo()?.GetResponseId()}");
|
showingNativeAds[key].NativeOverlayAd.Hide();
|
||||||
ad.Hide();
|
|
||||||
// 从字典中删除元素
|
// 从字典中删除元素
|
||||||
showingNativeAds.Remove(key);
|
showingNativeAds.Remove(key);
|
||||||
LoadAd(key);
|
LoadAd(key);
|
||||||
|
|
@ -401,9 +377,8 @@ namespace WZ
|
||||||
|
|
||||||
if (showingNativeAds.TryGetValue(adUnitId, out var tempAd))
|
if (showingNativeAds.TryGetValue(adUnitId, out var tempAd))
|
||||||
{
|
{
|
||||||
var ad = tempAd.NativeOverlayAd;
|
LoggerUtils.Debug($"[Admob] Native ad removing NativeAd {adUnitId}");
|
||||||
LoggerUtils.Debug($"[Admob] Native ad removing [showingNativeAds] {adUnitId} , ad {ad.GetResponseInfo()?.GetResponseId()}");
|
tempAd.NativeOverlayAd.Hide();
|
||||||
ad.Hide();
|
|
||||||
showingNativeAds.Remove(adUnitId);
|
showingNativeAds.Remove(adUnitId);
|
||||||
LoadAd(adUnitId);
|
LoadAd(adUnitId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue