1

I am using the Admob Native Ads template given at the documentation page in my App. The layout of the Ad is working fine but the test ads are not showing, I hope it because of the code I have used and I am showing it below, pls help me with you valuable opinions about the fault.

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        MobileAds.initialize(this, new OnInitializationCompleteListener() {
            @Override
            public void onInitializationComplete(InitializationStatus initializationStatus) {
            }
        });
        //Native
        AdLoader.Builder builder = new AdLoader.Builder(this,getString(R.string.NativeAd1));
        builder.forUnifiedNativeAd(new UnifiedNativeAd.OnUnifiedNativeAdLoadedListener() {
            @Override
            public void onUnifiedNativeAdLoaded(UnifiedNativeAd unifiedNativeAd) {
                TemplateView templateView = findViewById(R.id.Native_temp);
                templateView.setNativeAd(unifiedNativeAd);
            }
        });
        AdLoader adLoader = builder.build();
        AdRequest adRequest = new AdRequest.Builder().build();
        adLoader.loadAd(adRequest);
  • Have same probmem in 09/2020.I noticed it responds with error only for test slot, but for life slot id it gets valid `UnifiedNativeAd` object – undefined Sep 08 '20 at 15:03

0 Answers0