为什么AdMob返回NO FILL

我在Android应用中使用AdMob视图,但我无法将任何广告添加到应用中。

作为参考,我已经将这个视图添加到了一个ListView中,正如Dan Dyer在这里所解释的那样

编辑:我使用GoogleAdMobAdsSdk-4.1.1。 Google AdMob广告SDK 4.1.0版的发布说明指出:

“... - 添加了对AdRequest.addTestDevice()和AdRequest.setTestDevices()的支持。请注意AdRequest.setTesting()现在已被弃用...”

这是如何将广告插入到我的ListView中:

public View getView(int position, View convertView, ViewGroup parent) {

  // Some other code
  // Reusing convertView etc.

  AdView adView = 
     new AdView((Activity) getContext(), AdSize.BANNER, 
     "/xxxxxx/ca-pub-xxxxxxx/my_ad_unit");
  for (int i = 0; i < adView.getChildCount(); i++) {
    adView.getChildAt(i).setFocusable(false);
  }
  adView.setFocusable(false);
  float density = getContext().getResources().getDisplayMetrics().density;
  int height = Math.round(50 * density);
  AbsListView.LayoutParams params = new AbsListView.LayoutParams(
    AbsListView.LayoutParams.FILL_PARENT, height);

  adView.setLayoutParams(params);
  AdRequest request = new AdRequest();
  request.addTestDevice("xxxxxxxxxxxxxxxxx");
  adView.loadAd(request);

  // other stuff
  // returning convertView
}

我还为adview添加了AdListener,并在每个loadAd上调用onFailedToReceiveAd回调方法:

public void onFailedToReceiveAd(Ad arg0, ErrorCode arg1) {
  Log.d(TAG, "AdMob in list failed to receive ad: " + arg1.name());
}

在logcat中,我收到了以下消息:

08-17 15:22:18.065: AdMob in list failed to receive ad: NO_FILL

谁能告诉我这个错误代码的含义是什么?


要回答这个问题:

当AdMob / DFP后端没有剩余库存时,AdMob会返回NO_FILL。

首先,这意味着我正在请求一个尺寸为AxB的广告,但是后端没有剩下可以显示的尺寸的广告。 请求的尺寸在AdMob / DFP的后端系统中留下库存非常重要。

其次,他们的API声明,在您首次向特定广告单元请求广告时,您应该预计在广告开始投放前两分钟。 我不知道是不是因为我没有进驻美国,但这两分钟时间对我来说,如果不是几个小时,通常会变成至少20分钟。


当我在测试或非测试模式下提出广告请求时,我会收到“无填充”响应。 我该怎么办?

在测试和非测试模式下,根据各种参数(如服务器负载,目标广告的不可用性等),广告服务器可能会发送无填充响应。 尝试在一段时间后重新加载广告以继续接收广告。 虽然广告空间中没有填充是常见的,但您可以通过您的查询给我们写信。

http://developer.inmobi.com/wiki/index.php?title=Android


这实际上意味着目前没有您的FILL请求使用AdMob的广告。 以测试模式运行AdMob,您可以看到广告。

request.setTesting(true);
链接地址: http://www.djcxy.com/p/54383.html

上一篇: Why does AdMob return NO FILL

下一篇: Please help me understand Javascript anonymous functions and jQuery .proxy()