Android SDK Version
- AbstractAdListener
- Ad
- Ad.LoadAdConfig
- Ad.LoadConfigBuilder
- AdError
- AdExperienceType
- AdListener
- AdOptionsView
- AdOptionsView.Orientation
- AdSDKNotificationListener
- AdSDKNotificationListener.SDKEventKey
- AdSDKNotificationListener.SDKEventType
- AdSDKNotificationManager
- AdSettings
- AdSettings.IntegrationErrorMode
- AdSettings.TestAdType
- AdSize
- AdView
- AdView.AdViewLoadConfig
- AdView.AdViewLoadConfigBuilder
- AudienceNetworkActivity
- AudienceNetworkAds
- AudienceNetworkAds.AdFormat
- AudienceNetworkAds.InitListener
- AudienceNetworkAds.InitResult
- AudienceNetworkAds.InitSettingsBuilder
- AudienceNetworkContentProvider
- BidderTokenProvider
- CacheFlag
- DefaultMediaViewVideoRenderer
- ExtraHints
- ExtraHints.Builder
- ExtraHints.HintType
- ExtraHints.Keyword
- FullScreenAd
- FullScreenAd.ShowAdConfig
- FullScreenAd.ShowConfigBuilder
- InterstitialAd
- InterstitialAd.InterstitialAdLoadConfigBuilder
- InterstitialAd.InterstitialAdShowConfigBuilder
- InterstitialAd.InterstitialLoadAdConfig
- InterstitialAd.InterstitialShowAdConfig
- InterstitialAdExtendedListener
- InterstitialAdListener
- MediaView
- MediaViewListener
- MediaViewVideoRenderer
- MediaViewVideoRendererWithBackgroundPlayback
- NativeAd
- NativeAd.AdCreativeType
- NativeAdBase
- NativeAdBase.Image
- NativeAdBase.MediaCacheFlag
- NativeAdBase.NativeAdLoadConfigBuilder
- NativeAdBase.NativeComponentTag
- NativeAdBase.NativeLoadAdConfig
- NativeAdBase.Rating
- NativeAdLayout
- NativeAdListener
- NativeAdScrollView
- NativeAdScrollView.AdViewProvider
- NativeAdsManager
- NativeAdsManager.Listener
- NativeAdView
- NativeAdView.Type
- NativeAdViewAttributes
- NativeBannerAd
- NativeBannerAdView
- NativeBannerAdView.Type
- RewardData
- RewardedAdListener
- RewardedInterstitialAd
- RewardedInterstitialAd.RewardedInterstitialAdLoadConfigBuilder
- RewardedInterstitialAd.RewardedInterstitialAdShowConfigBuilder
- RewardedInterstitialAd.RewardedInterstitialLoadAdConfig
- RewardedInterstitialAd.RewardedInterstitialShowAdConfig
- RewardedInterstitialAdExtendedListener
- RewardedInterstitialAdListener
- RewardedVideoAd
- RewardedVideoAd.RewardedVideoAdLoadConfigBuilder
- RewardedVideoAd.RewardedVideoAdShowConfigBuilder
- RewardedVideoAd.RewardedVideoLoadAdConfig
- RewardedVideoAd.RewardedVideoShowAdConfig
- RewardedVideoAdExtendedListener
- RewardedVideoAdListener
- S2SRewardedInterstitialAdExtendedListener
- S2SRewardedInterstitialAdListener
- S2SRewardedVideoAdExtendedListener
- S2SRewardedVideoAdListener
- VideoAutoplayBehavior
- VideoStartReason
- java.lang.Object
- com.facebook.ads.NativeAdBase
- com.facebook.ads.NativeBannerAd
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 class com.facebook.ads.
NativeAdBase.Image, NativeAdBase.MediaCacheFlag, NativeAdBase.NativeAdLoadConfigBuilder, NativeAdBase.NativeComponentTag, NativeAdBase.NativeLoadAdConfig, NativeAdBase.Rating
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 Type | Method and Description |
---|---|
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. |
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. |
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. |
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. |
Methods inherited from class com.facebook.ads.
buildLoadAdConfig, destroy, downloadMedia, fromBidPayload, getAdBodyText, getAdCallToAction, getAdChoicesIcon, getAdChoicesImageUrl, getAdChoicesLinkUrl, getAdChoicesText, getAdCoverImage, getAdHeadline, getAdIcon, getAdLinkDescription, getAdSocialContext, getAdStarRating, getAdTranslation, getAdUntrimmedBodyText, getAdvertiserName, getAdViewAttributes, getAspectRatio, getId, getInternalNativeAd, getPlacementId, getPreloadedIconViewDrawable, getPromotedTranslation, getSponsoredTranslation, hasCallToAction, isAdInvalidated, isAdLoaded, isNativeConfigEnabled, loadAd, loadAd, onCtaBroadcast, setExtraHints, setOnTouchListener, unregisterView
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 displayiconView
- IconView to display Icon for this NativeBannerAdSince:
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 displayiconView
- IconView to display Icon for this NativeBannerAdclickableViews
- a list of all view elements that should handle taps on this unitSince:
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 displayiconView
- ImageView to display Icon for this NativeBannerAdSince:
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 displayiconView
- ImageView to display Icon for this NativeBannerAdclickableViews
- a list of all view elements that should handle taps on this unitSince:
5.4