2016-09-29 75 views
1

我为我的应用程序创建了自定义AdLoader。但它总是加载内容广告并且不会安装广告。如果我删除.forContentAd我将获得安装广告,但如果我离开这两个广告,我只会收到内容广告。谁能告诉我为什么?AdLoader始终加载内容广告

这里是我的代码:

new AdLoader.Builder(activityContext, getString(R.string.test_admob_unit_id)) 
       .forContentAd(new NativeContentAd.OnContentAdLoadedListener() { 
        @Override 
        public void onContentAdLoaded(NativeContentAd contentAd) { 
         adQueue.add(contentAd); 
        } 
       }) 
       .forAppInstallAd(new NativeAppInstallAd.OnAppInstallAdLoadedListener() { 
        @Override 
        public void onAppInstallAdLoaded(NativeAppInstallAd appInstallAd) { 
         adQueue.add(appInstallAd); 
        } 
       }) 

      .withAdListener(new AdListener() { 
       @Override 
       public void onAdFailedToLoad(int errorCode) { 
        // Handle the failure by logging, altering the UI, etc. 
       } 
      }) 
      .withNativeAdOptions(new NativeAdOptions.Builder() 
        // Methods in the NativeAdOptions.Builder class can be 
        // used here to specify individual options settings. 
        .build()) 
     .build(); 

回答

1

是的,我可以告诉你为什么。

当您提出请求时,AdMob的服务器将始终尝试挑选最能让您获利的广告。他们通过进行拍卖来实现这一点,其中不同广告客户的广告系列竞争成为您的应用中展示的广告系列。对于大多数高收入广告来说,有可能(特别是在世界的某些地区)集中在一种格式中。这可以让你看到一个类型的行中有上百个广告或更多。这是完全正常的,这只是您所在地区的更多广告客户希望购买一种类型的广告而非另一种类型的广告。

我看不出有任何问题,你AdLoader代码,因为你看到当你注释掉forContentAd()应用程式安装广告,我不相信你做错了什么。只有很多内容广告等待在您的邻居中展示。 :)