AdMob广告请求失败 [英] AdMob request fail

查看:174
本文介绍了AdMob广告请求失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用的AdMob广告的应用程序。它工作得很好,但有时服务器不能投放广告,所以我想到了服侍自己的广告(服务从我自己的服务器纯图像)。有没有什么办法来回调设置为AdRequest因此,如果申请失败,回调叫什么名字?

I'm running an app with AdMob ads. It works nicely, but sometimes the server can't serve an ad, so I thought about serving my own ads (plain images served from my own server). Is there any way to set a callback to the AdRequest so if the request fails, the callback is called?

推荐答案

您正在寻找AdMob的的 AdListener

You're looking for AdMob's AdListener:

public interface AdListener {
  public void onReceiveAd(Ad ad);
  public void onFailedToReceiveAd(Ad ad, AdRequest.ErrorCode error);
  public void onPresentScreen(Ad ad);
  public void onDismissScreen(Ad ad);
  public void onLeaveApplication(Ad ad);
}

具体而言, onFailedToReceiveAd 回调告诉你什么时候的AdMob无法返回的广告。让你的类实现这个接口来获取所有这些回调。只是不要忘记设置 AdListener AD浏览报

Specifically, the onFailedToReceiveAd callback tells you when AdMob couldn't return an ad. Have your class implement this interface to get all these callbacks. Just don't forget to set the AdListener on your AdView:

adView.setAdListener(this);

这篇关于AdMob广告请求失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆