1

我为我的应用程序创建了一个自定义 AdLoader。但它总是加载内容广告,从不安装广告。如果我删除.forContentAd,我会收到安装广告,但如果我同时离开,我只会收到内容广告。谁能告诉我为什么?

这是我的代码:

 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();
4

1 回答 1

1

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

当您提出请求时,AdMob 的服务器将始终尝试选择最能为您带来收益的广告。他们通过进行拍卖来做到这一点,在该拍卖中,不同广告客户的广告系列竞争成为您应用中展示的广告系列。大多数高收入广告都可能集中在一种格式中(尤其是在世界某些地区)。这可以使您在一种类型的行中看到一百个或更多广告。这是完全正常的,这只是由于您所在地区的广告客户想要购买一种类型的广告而不是另一种类型的广告。

我没有看到您的AdLoader代码有任何问题,而且由于您在注释掉时确实forContentAd()看到了应用安装广告,所以我认为您没有做错任何事情。只有一堆内容广告等待在您的附近展示。:)

于 2016-09-29T20:42:44.787 回答