gpt4 book ai didi

java - Admob 原生广告加载失败,错误代码为 0

转载 作者:太空狗 更新时间:2023-10-29 13:12:34 26 4
gpt4 key购买 nike

NativeExpressAdView adView = (NativeExpressAdView) findViewById(R.id.adView);
adView.loadAd(new AdRequest.Builder().build());

NativeExpressAdView is working fine but

AdLoader.Builder builder = new AdLoader.Builder(con, ADMOB_AD_UNIT_ID);

/*if (requestAppInstallAds)*/ {
builder.forAppInstallAd(new NativeAppInstallAd.OnAppInstallAdLoadedListener() {
@Override
public void onAppInstallAdLoaded(NativeAppInstallAd ad) {
//FrameLayout frameLayout =(FrameLayout) findViewById(R.id.fl_adplaceholder);
// NativeAppInstallAdView adView = (NativeAppInstallAdView) getLayoutInflater().inflate(R.layout.ad_app_install, null);

}
});
}


adLoader = builder.withAdListener(new AdListener() {
@Override
public void onAdFailedToLoad(int errorCode) {
Toast.makeText(con, "Failed to load native ad: "
+ errorCode, Toast.LENGTH_SHORT).show();
}

@Override
public void onAdClosed() {
super.onAdClosed();

}
}).build();


//adLoader.loadAd(new AdRequest.Builder().addTestDevice("9221FAA48B3F9AD9AA72601953B89E76").build());
adLoader.loadAd(new AdRequest.Builder().build());

如果使用实时广告 ID 它的显示无法加载错误代码 0,则测试广告可以正常工作,为什么?

最佳答案

NativeExpressAdView 现在才可用。您可以通过此链接请求原生 https://support.google.com/admob/contact/account_setup?rd=1

关于java - Admob 原生广告加载失败,错误代码为 0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38310274/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com