Unity Admob 横幅突然变大,底部有视频
Unity Admob banner suddenly becomes bigger with video on its bottom
最近我决定在游戏中添加 google admob 横幅广告。我已按照指南进行了每一步操作,并添加了我们的广告单元 ID。所以一切都很好,但横幅突然变大,并且显示视频的尺寸大约是横幅本身的三倍(甚至更大)。
我正在使用 unity 2020.1.13,并且我已经测试了不同的横幅尺寸作为 admob 指南建议(SmartBanner、AdaptiveBanner、(默认小)横幅、...)一切。但它每次都不停地打我的脸。以下图片是正常尺寸(我希望它保持不变)和较大的版本,10 次中出现 2-3 次。
Normal size
After loaded video size
请求横幅的代码是:
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 横幅广告的你们来说,看来你们不能使用视频横幅广告
最近我决定在游戏中添加 google admob 横幅广告。我已按照指南进行了每一步操作,并添加了我们的广告单元 ID。所以一切都很好,但横幅突然变大,并且显示视频的尺寸大约是横幅本身的三倍(甚至更大)。
我正在使用 unity 2020.1.13,并且我已经测试了不同的横幅尺寸作为 admob 指南建议(SmartBanner、AdaptiveBanner、(默认小)横幅、...)一切。但它每次都不停地打我的脸。以下图片是正常尺寸(我希望它保持不变)和较大的版本,10 次中出现 2-3 次。
Normal size | After loaded video size |
---|---|
请求横幅的代码是:
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 横幅广告的你们来说,看来你们不能使用视频横幅广告