【问题标题】:Unity banner ad admob v5.3.0 not showingunity 横幅广告 admob v5.3.0 不显示
【发布时间】:2021-11-04 06:26:20
【问题描述】:

我的横幅广告没有展示

使用 GoogleMobileAds v 5.3.0

已启用 Google AdMob 已选中,我输入了我的应用 ID

我的游戏在 google play 上直播我使用此代码显示添加(来自 youtube), 当我在编辑器中运行游戏时,我会在控制台中得到这个

Dummy.ctor / 虚拟初始化/ Dummy.ctor/ 虚拟 CreateBannerView/ 虚拟 ShowBannerView /

using UnityEngine;
using GoogleMobileAds.Api;
using System;

//Banner ad
  public class Addload : MonoBehaviour
 {
private string banner = "my ad ID";
private BannerView bannerad;

private void Start()
{
    MobileAds.Initialize(InitializationStatus => { } );

    RequestBanner();


}

private void RequestBanner ()
{

    

    bannerad = new BannerView(banner, AdSize.Banner, AdPosition.Bottom);

    AdRequest request = new AdRequest.Builder().Build();

    bannerad.Show();


}
}

【问题讨论】:

    标签: unity3d admob googlemobileads


    【解决方案1】:

    我认为您实际上忘记了加载广告。见:Banner Ads

    bannerad = new BannerView(banner, AdSize.Banner, AdPosition.Bottom);
    
    // Create an empty ad request.
    AdRequest request = new AdRequest.Builder().Build();
    
    // Load the banner with the request.
    this.bannerView.LoadAd(request);
    

    【讨论】:

    • 我是否保留“bannerad.Show();”?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-29
    相关资源
    最近更新 更多