public abstract class

NativeAdMapper

extends Object
java.lang.Object
   ↳ com.google.android.gms.ads.mediation.NativeAdMapper
Known Direct Subclasses

Class Overview

Base mapping class for AdMob native ads.

Summary

Fields
protected View mAdChoicesContent
protected Bundle mExtras
protected boolean mOverrideClickHandling
protected boolean mOverrideImpressionRecording
Public Constructors
NativeAdMapper()
Public Methods
View getAdChoicesContent()
Returns the view being used as AdChoices content.
final Bundle getExtras()
Returns a bundle of extras passed in setExtra method.
final boolean getOverrideClickHandling()
Returns true if the ad network does click handling on its own.
final boolean getOverrideImpressionRecording()
Returns true if the ad network does impression tracking on its own.
void handleClick(View view)
Subclasses should implement this method if the network requires the developer to explicitly handle click events of views rendered to screen.
boolean hasVideoContent()
Returns true if the current ad has video content.
void recordImpression()
Subclasses should implement this method if the network requires the developer to explicitly record an impression of a view rendered to screen.
void setAdChoicesContent(View adChoicesContent)
Set a view to be used as AdChoices content.
final void setExtras(Bundle extras)
Sets a bundle of extras containing attributes that are not already attributes of the Google native ad object.
void setHasVideoContent(boolean hasVideoContent)
Set to true if the current ad has video content.
void setMediaView(View mediaView)
Set mediated view that displays media.
final void setOverrideClickHandling(boolean overrideClickHandling)
Set to true if the ad network does click handling on its own.
final void setOverrideImpressionRecording(boolean overrideImpressionRecording)
Set to true if the ad network does impression tracking on its own.
void trackView(View view)
This method is deprecated. Use trackViews(View, Map, Map) instead.
void trackViews(View containerView, Map<String, View> clickableAssetViews, Map<String, View> nonclickableAssetViews)
Subclasses should implement this method if the network requires the developer to prepare state for recording an impression and/or click before a view is rendered to screen.
void untrackView(View view)
Subclasses should implement this method if the mediated network's SDK offers a way to stop tracking a native ad view for the ad mapped by this object.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected View mAdChoicesContent

protected Bundle mExtras

protected boolean mOverrideClickHandling

protected boolean mOverrideImpressionRecording

Public Constructors

public NativeAdMapper ()

Public Methods

public View getAdChoicesContent ()

Returns the view being used as AdChoices content.

Returns
View

public final Bundle getExtras ()

Returns a bundle of extras passed in setExtra method.

Returns
Bundle

public final boolean getOverrideClickHandling ()

Returns true if the ad network does click handling on its own.

Returns
boolean

public final boolean getOverrideImpressionRecording ()

Returns true if the ad network does impression tracking on its own.

Returns
boolean

public void handleClick (View view)

Subclasses should implement this method if the network requires the developer to explicitly handle click events of views rendered to screen.

Parameters
view View

public boolean hasVideoContent ()

Returns true if the current ad has video content.

Returns
boolean

public void recordImpression ()

Subclasses should implement this method if the network requires the developer to explicitly record an impression of a view rendered to screen.

public void setAdChoicesContent (View adChoicesContent)

Set a view to be used as AdChoices content.

Parameters
adChoicesContent View

public final void setExtras (Bundle extras)

Sets a bundle of extras containing attributes that are not already attributes of the Google native ad object.

Parameters
extras Bundle

public void setHasVideoContent (boolean hasVideoContent)

Set to true if the current ad has video content.

Parameters
hasVideoContent boolean

public void setMediaView (View mediaView)

Set mediated view that displays media. This is the View provided by the mediated SDK to display video content for the ad.

Parameters
mediaView View

public final void setOverrideClickHandling (boolean overrideClickHandling)

Set to true if the ad network does click handling on its own.

Parameters
overrideClickHandling boolean

public final void setOverrideImpressionRecording (boolean overrideImpressionRecording)

Set to true if the ad network does impression tracking on its own.

Parameters
overrideImpressionRecording boolean

public void trackView (View view)

This method is deprecated.
Use trackViews(View, Map, Map) instead.

Subclasses should implement this method if the network requires the developer to prepare state for recording an impression and/or click before a view is rendered to screen.

Parameters
view View

public void trackViews (View containerView, Map<String, View> clickableAssetViews, Map<String, View> nonclickableAssetViews)

Subclasses should implement this method if the network requires the developer to prepare state for recording an impression and/or click before a view is rendered to screen.

Parameters
containerView View: The container View for the ad.
clickableAssetViews Map: The Map of clickable asset names to corresponding View.
nonclickableAssetViews Map: The Map of non-clickable asset names to corresponding View.

Find the asset name constants in NativeContentAd or NativeAppInstallAd.

public void untrackView (View view)

Subclasses should implement this method if the mediated network's SDK offers a way to stop tracking a native ad view for the ad mapped by this object.

Parameters
view View