【发布时间】:2020-05-21 07:08:17
【问题描述】:
仅显示 admob 广告。等待2天。 我将优先级设置为 FAN,但没有任何 Facebook 受众网络广告请求。需要额外的原生广告请求代码?
private void loadNativeAds() {
mNativeAds = new ArrayList<>();
AdLoader.Builder builder = new AdLoader.Builder(MainActivity.this, getString(R.string.ad_unit_id));
adLoader = builder.forUnifiedNativeAd(
new UnifiedNativeAd.OnUnifiedNativeAdLoadedListener() {
@Override
public void onUnifiedNativeAdLoaded(UnifiedNativeAd unifiedNativeAd) {
// A native ad loaded successfully, check if the ad loader has finished loading
// and if so, insert the ads into the list.
mNativeAds.add(unifiedNativeAd);
if (!adLoader.isLoading()) {
insertAdsInMenuItems();
}
}
}).withAdListener(
new AdListener() {
@Override
public void onAdFailedToLoad(int errorCode) {
// A native ad failed to load, check if the ad loader has finished loading
// and if so, insert the ads into the list.
if (!adLoader.isLoading()) {
insertAdsInMenuItems();
}
}
}).build();
// Load the Native ads.
adLoader.loadAds(new AdRequest.Builder().build(), NUMBER_OF_ADS);
}
【问题讨论】:
-
有这方面的消息吗?
标签: android admob facebook-audience-network native-ads