最近我决定在游戏中添加 google admob 横幅广告。我已按照指南进行了每一步操作,并添加了我们的广告单元 ID。所以一切都很好,很酷,但突然间横幅变大了,并且显示的视频大小约为横幅本身的三倍(甚至更大)。
我使用的是 unity 2020.1.13,我已经测试了不同的横幅尺寸作为 admob 指南建议(SmartBanner、AdaptiveBanner、(默认小)横幅、...)一切。但它每次都不停地打我的脸。以下图片是正常尺寸(我希望它保持不变)和较大版本,每 10 次出现 2-3 次。
请求横幅的代码是:
public void RequestBanner(string unitID)
{
// Clean up banner ad before creating a new one.
if (this.bannerViewAd != null)
{
Debug.Log("|||| Prev Banner removed!");
this.bannerViewAd.Destroy();
}
AdSize adaptiveSize =
AdSize.GetPortraitAnchoredAdaptiveBannerAdSizeWithWidth(AdSize.FullWidth);
// Create a 320x50 banner at the top of the screen.
this.bannerViewAd = new BannerView(unitID, adaptiveSize, AdPosition.Bottom);
// Called when an ad request has successfully loaded.
this.bannerViewAd.OnAdLoaded += this.HandleOnAdLoaded;
// Called when an ad request failed to load.
this.bannerViewAd.OnAdFailedToLoad += this.HandleOnAdFailedToLoad;
// Called when an ad is clicked.
this.bannerViewAd.OnAdOpening += this.HandleOnAdOpened;
// Called when the user returned from the app after an ad click.
this.bannerViewAd.OnAdClosed += this.HandleOnAdClosed;
// Called when the ad click caused the user to leave the application.
this.bannerViewAd.OnAdLeavingApplication += this.HandleOnAdLeavingApplication;
// Create an empty ad request.
AdRequest adRequest = new AdRequest.Builder().Build();
// Load the banner with the request.
this.bannerViewAd.LoadAd(adRequest);
}
在代码中你看到了 adaptivesize 和 constantSize ,我测试了两者并得到了相同的结果,我也测试了智能横幅和相同的结果。
最佳答案
直到现在我都找不到任何解决方案,即使联系了 admob 支持他们也拒绝回答我。
所以对于你们这些使用 admob 横幅广告的人来说,似乎你们不能使用视频横幅广告
关于unity3d - Unity Admob 横幅突然变大,底部有视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65747858/