我正在设置一个集成了AdMob插件的统一应用。一切正常,但是当我请求横幅广告时,应用程序崩溃了,但在请求插页式广告或视频广告时,它运行正常
H 6-7/3 * * *
答案 0 :(得分:0)
您应该在显示横幅广告之前检查广告是否已加载:
void RequestBanner()
{
string banner_ID = "ca-app-pub-3940256099942544/6300978111";
bannerAD = new BannerView(banner_ID,AdSize.SmartBanner, AdPosition.Top);
bannerAD.OnAdLoaded += HandleOnAdLoaded;
AdRequest adRequest = new AdRequest.Builder().AddTestDevice("2077ef9a63d2b398840261c8221a0c9b").Build();
bannerAD.LoadAd(adRequest);
}
public void HandleOnAdLoaded(object sender, EventArgs args)
{
bannerAD.Show();
}