Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Admob Native ads failed to load with error code 0

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

works fine with test ads if use live ads id its show failed to load error code 0 Why?

like image 733
user3663433 Avatar asked Jul 02 '26 00:07

user3663433


1 Answers

NativeExpressAdView is only available now. you can request for native through this link https://support.google.com/admob/contact/account_setup?rd=1

like image 198
arun Avatar answered Jul 04 '26 12:07

arun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!