为什么 AdMob 返回 NO FILL

问题描述 投票:0回答:5

我在 Android 应用程序中使用 AdMob 视图,但无法将任何广告放入应用程序中。

作为参考,我已将视图添加到 ListView,如 Dan Dyer here

所解释

编辑: 我正在使用 GoogleAdMobAdsSdk-4.1.1。 Google AdMob Ads 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

谁能告诉我这个错误代码是什么意思?

android listview admob
5个回答
3
投票

回答问题:

当没有剩余库存时,AdMob 返回 NO_FILL 在 AdMob/DFP 后端中提供服务。

首先,这意味着我正在请求尺寸为 AxB 的广告,但后端没有该尺寸的广告可供展示。您请求的尺寸必须在 AdMob/DFP 后端系统中留有库存,这一点很重要。

其次,他们的 API 规定,当您第一次向特定广告单元请求广告时,您最多需要等待两分钟才能开始投放广告。我不知道是不是因为我不在美国驻扎,但这两分钟对我来说经常变成至少20分钟甚至几个小时。


1
投票

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

在测试和非测试模式下,根据服务器负载、目标广告不可用等各种参数,广告服务器可能会发送“无填充”响应。尝试在一段时间后重新加载广告以继续接收广告。尽管“不填写”在广告空间中很常见,但您可以写信给我们提出您的疑问。

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


0
投票

这实质上意味着 AdMob 目前没有可满足您的 FILL 请求的广告。在测试模式下运行 AdMob,您就可以看到广告了。

request.setTesting(true);

0
投票

更改市场上可用的实时应用程序或游戏的包名称。 并在项目中使用您的新admob-id,检查一次..


0
投票

转到您的应用程序级别 gradle 文件并将您的应用程序 ID 更改为 com.yourownpackagename.adapp 之类的内容。如果您的应用程序 ID 为 com.example.adapp,它可能不会加载任何广告,或者可能返回无填充错误。因此,不要使用 example 作为包名称。

© www.soinside.com 2019 - 2024. All rights reserved.