Android SDK Version
All Implemented Interfaces:

public class NativeBannerAd
extends NativeAdBase
NativeBannerAd provides an ad creative for apps to render on a custom layout.
To use NativeBannerAd, do the following:
 NativeBannerAd nativeBannerAd = new NativeBannerAd(context, PLACEMENT_ID); nativeBannerAd.setAdListener(new AbstractAdListener() { public void onAdLoaded(Ad ad) { if (ad == nativeBannerAd) { // Render the ad using the different properties. Eg.: String adTitle = getAdTitle(); } } }); nativeBannerAd.loadAd(); 
Before displaying the ad, call com.facebook.ads.NativeBannerAd#registerViewForInteraction( android.view.View viewContainer, MediaView iconView) to handle logging of ad impressions and clicks.
Since:
4.99
Nested Class Summary
Constructor Summary
Constructor and Description
NativeBannerAd(Context context, java.lang.String placementId) 
Method Summary
Modifier and TypeMethod and Description
voidregisterViewForInteraction(View view, MediaView iconView)
Registers the given view as the container and the required IconView as the Icon display for this NativeBannerAd to handle impressions and clicks.
voidregisterViewForInteraction(View view, MediaView iconView, java.util.List<View> clickableViews)
Registers the given view as the container and the required IconView as the Icon display for this NativeBannerAd to handle impressions and clicks.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail

NativeBannerAd

public NativeBannerAd(Context context,
                      java.lang.String placementId)
Parameters:
context -
placementId -
Since:
4.99
Method Detail

registerViewForInteraction

public void registerViewForInteraction(View view,
                                       MediaView iconView)
Registers the given view as the container and the required IconView as the Icon display for this NativeBannerAd to handle impressions and clicks. IconView must be within the view passed as the container for this NativeBannerAd. Applies a click handler to the entire unit.
Parameters:
view - the View containing this NativeBannerAd for display
iconView - IconView to display Icon for this NativeBannerAd
Since:
4.99

registerViewForInteraction

public void registerViewForInteraction(View view,
                                       MediaView iconView,
                                       java.util.List<View> clickableViews)
Registers the given view as the container and the required IconView as the Icon display for this NativeBannerAd to handle impressions and clicks. IconView must be within the view passed as the container for this NativeBannerAd. Applies a click handler to the entire unit.
Parameters:
view - the View containing this NativeBannerAd for display
iconView - IconView to display Icon for this NativeBannerAd
clickableViews - a list of all view elements that should handle taps on this unit
Since:
4.99