2016-09-29 73 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()應用程式安裝廣告,我不相信你做錯了什麼。只有很多內容廣告等待在您的鄰居中展示。 :)