【问题标题】:The test succeeds in the editor, but it does not appear on the mobile在编辑器中测试成功,但是在手机上没有出现
【发布时间】:2021-02-07 14:40:20
【问题描述】:

我目前正在 Unity 2020 上单独开发一款适用于 Android 的游戏。 我已经完成了大部分游戏开发,我所要做的就是启用广告。

我参考了 Google Ads 官方文档和其他文献,但没有奏效。 具体来说,我所做的是向 Admob 注册一个新应用并发布一个新的广告 ID。此外,我正在申请在 Google Play 控制台上发布该应用。

代码与文档中介绍的完全相同;

void Start()
{
    // Initialize the Google Mobile Ads SDK.
    MobileAds.Initialize(initStatus => { });

    RequestBanner();
}

private void RequestBanner()
{

    string adUnitId = "(correct Unit ID)";

    // Create a 320x50 banner at the top of the screen.
    BannerView bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Bottom);

    // Create an empty ad request.
    AdRequest request = new AdRequest.Builder().Build();

    // Load the banner with the request.
    bannerView.LoadAd(request);

    // Create a 320x50 banner at the top of the screen.
    //bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top);
}

测试在编辑器中显示成功,如下图;

然后我构建了游戏并在手机上进行了试用。 那么广告就不会显示了。

是因为该应用尚未发布到 Google Play 吗?

谢谢。

【问题讨论】:

    标签: c# android unity3d admob


    【解决方案1】:

    由于某种原因,广告刚刚开始出现。 可能是因为我创建项目的时间还不够长。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-08-25
      • 2022-11-28
      • 2020-12-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多