我为我的应用程序创建了一个自定义 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();