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
Nested classes/interfaces inherited from interface com.facebook.ads.
Ad.LoadAdConfig, Ad.LoadConfigBuilder
Constructor Summary
Constructor and Description
NativeBannerAd(Context context, com.facebook.ads.internal.api.NativeAdBaseApi nativeAdBaseApi) 
NativeBannerAd(Context context, java.lang.String placementId) 
Method Summary
Modifier and TypeMethod and Description
voidregisterViewForInteraction(View view, ImageView iconView)
Registers the given view as the container and the required ImageView as the Icon display for this NativeBannerAd to handle impressions and clicks.
voidregisterViewForInteraction(View view, ImageView iconView, java.util.List<View> clickableViews)
Registers the given view as the container and the required ImageView as the Icon display for this NativeBannerAd to handle impressions and clicks.
voidregisterViewForInteraction(View view, MediaView iconView)
Registers the given view as the container and the required MediaView 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 MediaView 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

NativeBannerAd

public NativeBannerAd(Context context,
                      com.facebook.ads.internal.api.NativeAdBaseApi nativeAdBaseApi)
Method Detail

registerViewForInteraction

public void registerViewForInteraction(View view,
                                       MediaView iconView)
Registers the given view as the container and the required MediaView as the Icon display for this NativeBannerAd to handle impressions and clicks. MediaView 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 MediaView as the Icon display for this NativeBannerAd to handle impressions and clicks. MediaView 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

registerViewForInteraction

public void registerViewForInteraction(View view,
                                       ImageView iconView)
Registers the given view as the container and the required ImageView as the Icon display for this NativeBannerAd to handle impressions and clicks. ImageView 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 - ImageView to display Icon for this NativeBannerAd
Since:
5.4

registerViewForInteraction

public void registerViewForInteraction(View view,
                                       ImageView iconView,
                                       java.util.List<View> clickableViews)
Registers the given view as the container and the required ImageView as the Icon display for this NativeBannerAd to handle impressions and clicks. ImageView 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 - ImageView to display Icon for this NativeBannerAd
clickableViews - a list of all view elements that should handle taps on this unit
Since:
5.4