Unity Admob横幅广告突然变得更大,底部有视频。

3
最近我决定在游戏中添加Google Admob横幅广告。我按照指南的每个步骤进行操作并添加了我们的广告单元ID。所以一切都很好,但突然间横幅变得更大,并且显示的视频大小是横幅本身的三倍甚至更大。
我正在使用Unity 2020.1.13,我已经按照Admob指南建议测试了不同的横幅尺寸(智能横幅、自适应横幅、(默认小)横幅等),但每次都会让我感到困惑。以下图片展示了我期望保持的正常大小和发生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 两种选项,我测试了两种选项得出的结果是相同的,同时我也测试了智能横幅广告,结果也是相同的。

我的本地Android应用程序也出现了这种情况。 adSize是使用AdMob SDK中的方法“AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize()”设置的。 这是预期的广告横幅大小:https://ibb.co/L1dh971 这是错误的屏幕截图: 半屏阻塞:https://ibb.co/kJkBzGd 全屏阻塞:https://ibb.co/1snkTh5 - Noel Chew
@NoelChew 我也在 Github 上的 admob 包存储库中打开了此问题,以下链接将重定向到该问题。经过数天的寻找解决方案,我们放弃了视频横幅以解决这个问题。 https://github.com/googleads/googleads-mobile-unity/issues/1557 - Ali Paknahad
1个回答

1

迄今为止,即使联系了admob支持团队,我仍然无法找到任何解决方案,他们拒绝回答我的问题。

因此,对于使用admob横幅广告的用户,似乎不能使用视频横幅广告。


我发现我们网站也遇到了这个问题。一个320x50的广告位现在占据了手机屏幕的100%宽度,并保持了原来的比例,导致高度变高,影响了我们的粘性页眉逻辑等其他元素,进而影响了CLS。防止这种情况发生真是一件非常烦人的事情,我希望这不会成为一种趋势。 - Scott L
@ScottLeonard 是的,我知道。这真的很痛苦。Admob在GitHub上的问题已经超过6个月了,支持令人难以置信。 - Ali Paknahad
我在Android Studio上也遇到了同样的问题,已经持续了将近5个月。 - Regex

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接