Accéder à la console

UnifiedNativeAdMapper

public abstract class UnifiedNativeAdMapper extends Object

Mapping class for Google AdMob unified native ads.

Mediation adapters that load a native ad must extend this class to provide a mapping from the mediated ad network's native ad object to UnifiedNativeAd.

Public Constructor Summary

Public Method Summary

View
getAdChoicesContent()
Returns the view being used as AdChoices content.
final String
getAdvertiser()
Returns the text that identifies the advertiser.
final String
getBody()
Returns body text.
final String
getCallToAction()
Returns the text that encourages the user to take some action with the ad.
final Bundle
getExtras()
Returns the bundle of extras passed in via the setExtras method.
final String
getHeadline()
Returns the primary text headline.
final NativeAd.Image
getIcon()
Returns a small image identifying the advertiser.
final List<NativeAd.Image>
getImages()
Returns a list of large images.
float
getMediaContentAspectRatio()
Returns the aspect ratio of the media to be rendered in the MediaView.
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.
final String
getPrice()
For ads about apps, returns a string representing how much the app costs.
final Double
getStarRating()
For ads about apps, returns a star rating from 0 to 5 representing how many stars the app has in the store offering it.
final String
getStore()
For ads about apps, returns the name of the store offering the app for download.
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)
Sets a view to be used as AdChoices content.
final void
setAdvertiser(String advertiser)
Sets a text that identifies the advertiser.
final void
setBody(String body)
Sets body text.
final void
setCallToAction(String callToAction)
Sets the ad's call to action (such as "Buy" or "Install").
final void
setExtras(Bundle extras)
Sets a bundle of extras containing assets or attributes that do not directly map to those expected for a Google native ad object (headline, body, etc).
void
setHasVideoContent(boolean hasVideoContent)
Set to true if the current ad has video content.
final void
setHeadline(String headline)
Sets the primary text headline.
final void
setIcon(NativeAd.Image icon)
Sets a small image identifying the advertiser.
final void
setImages(List<NativeAd.Image> images)
Sets a list of large images.
void
setMediaContentAspectRatio(float mediaContentAspectRatio)
Sets the aspect ratio of the media to be rendered in the MediaView.
void
setMediaView(View mediaView)
Sets 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.
final void
setPrice(String price)
For ads about apps, sets a string representing how much the app costs.
final void
setStarRating(Double starRating)
For ads about apps, sets a star rating from 0 to 5 representing how many stars the app has in the store offering it.
final void
setStore(String store)
For ads about apps, sets the name of the store offering the app for download.
void
trackViews(View containerView, Map<StringView> clickableAssetViews, Map<StringView> 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.

Inherited Method Summary

Public Constructors

public UnifiedNativeAdMapper ()

Public Methods

public View getAdChoicesContent ()

Returns the view being used as AdChoices content.

public final String getAdvertiser ()

Returns the text that identifies the advertiser.

public final String getBody ()

Returns body text.

public final String getCallToAction ()

Returns the text that encourages the user to take some action with the ad.

public final Bundle getExtras ()

Returns the bundle of extras passed in via the setExtras method.

public final String getHeadline ()

Returns the primary text headline.

public final NativeAd.Image getIcon ()

Returns a small image identifying the advertiser.

public final List<NativeAd.Image> getImages ()

Returns a list of large images.

public float getMediaContentAspectRatio ()

Returns the aspect ratio of the media to be rendered in the MediaView. Returns zero if the aspect ratio is not available.

public final boolean getOverrideClickHandling ()

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

public final boolean getOverrideImpressionRecording ()

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

public final String getPrice ()

For ads about apps, returns a string representing how much the app costs.

public final Double getStarRating ()

For ads about apps, returns a star rating from 0 to 5 representing how many stars the app has in the store offering it.

public final String getStore ()

For ads about apps, returns the name of the store offering the app for download. For example, "Google Play".

public void