Mopub Ads Not Showing

Can't see Mopub ads

err.. Sorry the problem was with the country. There was no ads in my country to show. I just checked with VPN, set my country to USA and there were ads :-)
I had the same problem in Revmob, so tried this. Thanks anyways.

No Ads Found' With MoPub Native Ads and Facebook

Under MoPub's Integrating 3rd Party Ad Networks it explains that a unique Ad Renderer is required for Facebook in addition to using a specific Facebook layout.

FacebookAdRenderer facebookAdRenderer = new FacebookAdRenderer(
new FacebookAdRenderer.FacebookViewBinder.Builder(R.layout.native_ad_list_item)
.titleId(R.id.native_title)
.textId(R.id.native_text)
// Binding to new layouts from Facebook 4.99.0+
.mediaViewId(R.id.native_main_image)
.adIconViewId(R.id.native_icon_image)
.adChoicesRelativeLayoutId(R.id.native_ad_choices_relative_layout)
.advertiserNameId(R.id.native_title) // Bind either the titleId or advertiserNameId depending on the FB SDK version
// End of binding to new layouts
.callToActionId(R.id.native_cta)
.build());

To know which specific layout elements to use in your XML for the MediaView, AdIconView, and AdChoices RelativeLayout in the FacebookViewBinder, please reference this sample XML layout. Additionally, depending on the Facebook SDK version you are integrating, you will need to show only either the ad title or the advertiser name. For more information about Facebook’s implementation requriements, check out this article.

Then, register your ad renderers, like below. Your classThatRegistersAdRenderers varies depending on which native ad integration you are using. Remember to register your MoPubStaticNativeAdRenderer instance last.

// MoPubRecyclerAdapter
MoPubRecyclerAdapter classThatRegistersAdRenderers = new MoPubRecyclerAdapter(...);

// MoPubStreamAdPlacer
MoPubStreamAdPlacer classThatRegistersAdRenderers = new MoPubStreamAdPlacer(...);

// MoPubAdAdapter
MoPubAdAdapter classThatRegistersAdRenderers = new MoPubAdAdapter(...);

// MoPubNative
MoPubNative classThatRegistersAdRenderers = new MoPubNative(...);

classThatRegistersAdRenderers.registerAdRenderer(
googlePlayServicesAdRenderer);

classThatRegistersAdRenderers.registerAdRenderer(
flurryNativeAdRenderer);

classThatRegistersAdRenderers.registerAdRenderer(facebookAdRenderer);

classThatRegistersAdRenderers.registerAdRenderer(staticAdRender);


Related Topics



Leave a reply



Submit