【问题标题】:Unity Admob banner suddenly becomes bigger with video on its bottomUnity Admob 横幅突然变大,底部有视频
【发布时间】:2021-04-21 04:14:44
【问题描述】:

最近我决定在游戏中添加 google admob 横幅广告。我已经按照指南的每一步操作,也添加了我们的 ad-unit-id。所以一切都很好,很酷,但突然横幅变大了,并以大约三倍(甚至更大)横幅本身的大小显示视频。

我正在使用统一 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,我测试了两者并得出了相同的结果,我也测试了智能横幅和相同的结果。

【问题讨论】:

  • 这也发生在我的原生 Android 应用上。使用 AdMob SDK “AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize()” 中的方法设置 adSize 这是预期的广告横幅尺寸:ibb.co/L1dh971 这是错误的屏幕截图: 半屏块:ibb.co/kJkBzGd 全屏块:ibb.co/1snkTh5
  • @NoelChew 我也在 github 的 admob 包仓库上打开了这个 issue,下面的链接会重定向到这个 issue。经过几天寻找解决方案,我们放弃了视频横幅来解决这个问题。 github.com/googleads/googleads-mobile-unity/issues/1557

标签: unity3d admob banner banner-ads


【解决方案1】:

直到现在我都找不到任何解决方案,即使在联系了 admob 支持后他们也拒绝回答我。

所以对于使用 admob 横幅广告的你们来说,似乎你不能使用视频横幅

【讨论】:

  • 我看到我们的网站也发生了这种情况。一个 320x50 的广告位现在是手机宽度的 100%,它保持了尺寸比,导致高度更高,影响 CLS 以及我们的粘性标题逻辑。试图阻止这种情况的完全痛苦,我希望这不会成为一种趋势。
  • @ScottLeonard 是的,我知道。真的很痛苦。 6 个多月后,admob GitHub 上的问题仍然存在。令人难以置信的支持
  • 我在 Android Studio 上面临同样的问题近 5 个月了。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-03-31
相关资源
最近更新 更多