Native Ads without adapter

mopub

#1

hi, i am trying to use Native Ads

that’s my code

 MoPubNative.MoPubNativeNetworkListener moPubNativeListener = new MoPubNative.MoPubNativeNetworkListener() {
            @Override
            public void onNativeLoad(NativeAd nativeAd) {


                View adViewRender = nativeAd.createAdView(context, (ViewGroup) getParent());
                nativeAd.renderAdView(adViewRender);
                nativeAd.prepare(adViewRender);

                Log.d("SUCCEESSSSO"," SUCCEESSSSO");

            }

            @Override
            public void onNativeFail(NativeErrorCode errorCode) {
                Log.d("LockUpMopub",errorCode+ " errorcode");
            }
        };

        MoPubNative mMoPubNative = new MoPubNative(context
                ,"78b42e618b7a41ff99e9f62d1b0bd7ad",moPubNativeListener);

        ViewBinder viewBinder = new ViewBinder.Builder(R.layout.native_ad_layout)
                .mainImageId(R.id.native_ad_main_image)
                .iconImageId(R.id.native_ad_icon_image)
                .titleId(R.id.native_ad_title)
                .textId(R.id.native_ad_text)
                .callToActionId(R.id.native_ad_call_to_action)
                .build();

        MoPubStaticNativeAdRenderer adRenderer = new MoPubStaticNativeAdRenderer(viewBinder);

        mMoPubNative.registerAdRenderer(adRenderer);
        mMoPubNative.makeRequest();
}

I receive the ads but nothing appear… anyone can help me please… i need that because i want place a native ads outside a list view and serve my own adv thanks


#2

Hi @AltIndustries,

Thanks for reaching out! If you can share the device logs from your testing with our Support Team they will be able to help you understand why you aren’t seeing any ads. The Support Team can be reached at support@mopub.com. Please make sure to include the email address associated with your account and your ad unit IDs in your email.

Thanks!