![](/img/trans.png)
[英]Facebook Audience Network native Ads via Admob mediation adapter
[英]Admob mediation native advance ads not serve Facebook audience network ads
僅顯示 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);
}
根據此處的文檔,
loadAds()
方法目前僅適用於 AdMob 廣告。 對於中介廣告,請改用loadAd()
。
將adLoader.loadAds()
更改為adLoader.loadAd()
應該會開始加載 Facebook Audience Network 原生廣告。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.