A Google native ad. Unlike NativeAppInstallAd
and NativeContentAd,
this class may contain either an app install ad or a content ad.
| interface | UnifiedNativeAd.OnUnifiedNativeAdLoadedListener | An interface defining a callback that is called when a native ad is loaded. | |
| interface | UnifiedNativeAd.UnconfirmedClickListener | A listener interface apps can use to receive unconfirmed click events when using the Confirmed Click feature. | |
| abstract void |
cancelUnconfirmedClick()
Cancels an unconfirmed click that was previously recorded for the ad.
|
| abstract void |
destroy()
Destroy the ad object.
|
| abstract void |
enableCustomClickGesture()
Enable publishers reporting clicks using custom gestures for this
UnifiedNativeAd.
|
| abstract NativeAd.AdChoicesInfo |
getAdChoicesInfo()
Returns the information for the AdChoices attribution.
|
| abstract String |
getAdvertiser()
Returns text that identifies the advertiser.
|
| abstract String |
getBody()
Returns body text.
|
| abstract String |
getCallToAction()
Returns the ad's call to action (such as "Buy" or "Install").
|
| abstract Bundle |
getExtras()
Returns a bundle of extra assets associated with the native ad.
|
| abstract String |
getHeadline()
Returns the primary text headline.
|
| abstract NativeAd.Image |
getIcon()
Returns a small image identifying the advertiser.
|
| abstract List<NativeAd.Image> |
getImages()
Returns a list of large images.
|
| abstract MediaContent |
getMediaContent()
Returns the
MediaContent
associated with this ad.
|
| abstract String |
getMediationAdapterClassName()
This method is deprecated. Use
getResponseInfo() and
getMediationAdapterClassName().
|
| abstract List<MuteThisAdReason> |
getMuteThisAdReasons()
Returns Mute This Ad reasons available for this ad.
|
| abstract String |
getPrice()
For ads about apps, returns a string representing how much the app costs.
|
| abstract ResponseInfo | |
| abstract 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.
|
| abstract String |
getStore()
For ads about apps, returns the name of the store offering the app for
download.
|
| abstract VideoController |
getVideoController()
This method is deprecated. Use
getVideoController().
|
| abstract boolean |
isCustomClickGestureEnabled()
Indicates whether clicks can be reported using custom click gestures.
|
| abstract boolean |
isCustomMuteThisAdEnabled()
Returns
true if this ad can be muted programmatically.
|
| abstract void | |
| abstract void | |
| abstract void |
recordCustomClickGesture()
Report clicks for this
UnifiedNativeAd
using custom click gesture.
|
| abstract boolean | |
| abstract void | |
| abstract void | |
| abstract void |
setOnPaidEventListener(OnPaidEventListener
listener)
Register a callback to be invoked when this ad is estimated to have earned
money.
|
| abstract void |
setUnconfirmedClickListener(UnifiedNativeAd.UnconfirmedClickListener
listener)
Set the UnconfirmedClickListener for the ad.
|
Cancels an unconfirmed click that was previously recorded for the ad.
Destroy the ad object. No other methods should be called on the ad object after
destroy is called.
Enable publishers reporting clicks using custom gestures for this UnifiedNativeAd.
The ad unit must be whitelisted to be able to use this method.
By default SDK tracks clicks on asset views. If this method is called, SDK will no
longer track clicks for this UnifiedNativeAd.
It should be called before showing the ad.
Returns the information for the AdChoices attribution.
Returns text that identifies the advertiser. Apps are not required to display this asset, though it's recommended.
Returns body text. Apps are required to display this asset.
Returns the ad's call to action (such as "Buy" or "Install"). Apps are not required to display this asset, though it's recommended.
Returns a bundle of extra assets associated with the native ad. If a mediation
partner's ad have assets besides the standard ones (price, store, etc.), they can be
set by calling the method in
setExtras(Bundle), and can be retrieved via this method. For non-mediation
flow, it returns an empty bundle.
Returns the primary text headline. Apps are required to display this asset.
Returns a small image identifying the advertiser. Apps are not required to display this asset, though it's recommended.
Returns a list of large images. Apps are not required to display this asset, though it's recommended.
Returns the MediaContent
associated with this ad.
This method is deprecated.
Use
getResponseInfo() and
getMediationAdapterClassName().
Returns the mediation adapter class name. In the case of a mediated ad response, this is the name of the class that was responsible for performing the ad request and returning the ad.
Returns Mute This Ad reasons available for this ad. Use the text description from
MuteThisAdReason
class for showing to user.
For ads about apps, returns a string representing how much the app costs. Apps are not required to display this asset, though it's recommended.
For ads about apps, returns a star rating from 0 to 5 representing how many stars the app has in the store offering it. Apps are not required to display this asset, though it's recommended.
For ads about apps, returns the name of the store offering the app for download. For example, "Google Play". Apps are not required to display this asset, though it's recommended.
This method is deprecated.
Use getVideoController().
Returns the VideoController
associated with this ad. This is never null. To check if an ad contains a video asset,
call the hasVideoContent()
method on the returned VideoController
object.
Indicates whether clicks can be reported using custom click gestures. Reach out to your account manager to whitelist your ad unit for this feature.
Returns true if this ad can be muted programmatically. Use
setRequestCustomMuteThisAd(boolean) to request custom implementation of Mute
This Ad.
Mutes This Ad programmatically.
| muteThisAdReason | The mute reason selected by the user. Get mute reasons from
getMuteThisAdReasons(). Use null to Mute This Ad with
default reason. |
|---|
Should be called when the user has clicked on the ad. The ad unit must be whitelisted to be able to use this api. This method should only be used by Unity plugin publishers.
| clickData | bundle of the app environment when the click happens. For details to construct
the click data Bundle, see
NativeAdConstants. |
|---|
Report clicks for this UnifiedNativeAd
using custom click gesture. The ad unit must be whitelisted to be able to use this
method.
enableCustomClickGesture() must be called before calling this method.
Should be called when the ad is first displayed. The ad unit must be whitelisted to be able to use this api.
| impressionData | bundle of the app environment when the impression happens. For details to
construct the click data Bundle, see
NativeAdConstants. |
|---|
Should be called when a touch event happens on the ad. The ad unit must be whitelisted to be able to use this api. If you are interested in using this feature, reach out to your account manager.
| touchEventData |
bundle of touch event coordinates and duration.
Example JSON representation of touchEventData Bundle:
{
"x": "100", // The x-coordinate of the touch event relative to the window.
"y": "50", // The y-coordinate of the touch event relative to the window.
"duration_millis": "500", // The amount of milliseconds the user pressed on the asset.
}
|
|---|
Sets the MuteThisAdListener
for the ad.
Register a callback to be invoked when this ad is estimated to have earned money.
Set the UnconfirmedClickListener for the ad.