| Modifier and Type | Class and Description |
|---|---|
static interface |
NativeAd.NativeAdListener |
static interface |
NativeAd.NativeAdMediaListener |
adConfig, metricFactory| Constructor and Description |
|---|
NativeAd(int slotId,
android.content.Context context)
Public constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
getAdChoicesPlacement()
Retrieve current position for AdChoices icon
|
java.lang.String |
getAdSource()
Get the name of source network.
|
float |
getAdSourcePriority()
Ad Source Priority is the value representing current ad network place in the queue of
received advertisements.
|
NativePromoBanner |
getBanner()
Banner model for current ad.
|
int |
getCachePolicy()
Retrieve current cachePolicy set previously
|
NativeAd.NativeAdListener |
getListener()
Get events listener of an advertisement
|
NativeAd.NativeAdMediaListener |
getMediaListener()
Gets listener for media objects events, such as icon loading
|
void |
handleData(java.lang.String data)
Loads data for s2s partners
|
void |
handleSection(NativeAdSection section) |
boolean |
isMediationEnabled()
Get enable/disable mediation flag
|
boolean |
isUseExoPlayer()
Gets current flag of using ExoPlayer for video playing
|
void |
load()
Start loading ads.
|
void |
loadFromBid(java.lang.String bidId)
Start loading ad with the bidding ID
|
void |
registerView(android.view.View view)
Registration of the Advertising view.
|
void |
registerView(android.view.View view,
java.util.List<android.view.View> clickableViews)
Registration of the Advertising view.
|
void |
setAdChoicesPlacement(int adChoicesPlacement)
Sets the place for AdChoices icon, by default
used top-right position
|
void |
setCachePolicy(int cachePolicy)
By default, images and videos are preloaded.
|
void |
setListener(NativeAd.NativeAdListener listener)
Set events listener of an advertisement
Must be called before
load() |
void |
setMediaListener(NativeAd.NativeAdMediaListener mediaListener)
Sets listener for media objects events, such as icon loading
|
void |
setMediationEnabled(boolean mediationEnabled)
Enables/disables mediation for current ad.
|
void |
unregisterView()
View de-registration.
|
void |
useExoPlayer(boolean useExoPlayer)
Enables/disables ExoPlayer to play video.
|
getCustomParams, isLoadCalledpublic NativeAd(int slotId,
@NonNull
android.content.Context context)
slotId - your slot idcontext - app contextpublic int getCachePolicy()
getCachePolicy in interface INativeAdCachePolicypublic void setCachePolicy(int cachePolicy)
setCachePolicy in interface INativeAdcachePolicy - cache policy needed CachePolicypublic void setMediationEnabled(boolean mediationEnabled)
mediationEnabled - if true - enable mediation, otherwise notpublic boolean isMediationEnabled()
@Nullable public NativeAd.NativeAdListener getListener()
NativeAd.NativeAdListenerpublic void setListener(@Nullable
NativeAd.NativeAdListener listener)
load()NativeAd.NativeAdListener@Nullable public NativePromoBanner getBanner()
NativePromoBannerpublic int getAdChoicesPlacement()
getAdChoicesPlacement in interface INativeAdAdChoicesPlacementpublic void setAdChoicesPlacement(int adChoicesPlacement)
setAdChoicesPlacement in interface INativeAdadChoicesPlacement - positionAdChoicesPlacementpublic final void load()
Ad listener should be added before this call
public void loadFromBid(@NonNull
java.lang.String bidId)
loadFromBid in interface INativeAdbidId - bidding IDpublic final void handleSection(@NonNull
NativeAdSection section)
public final void registerView(@NonNull
android.view.View view,
@Nullable
java.util.List<android.view.View> clickableViews)
registerView in interface INativeAdview - Advertising viewclickableViews - specific clickable views inside Advertising view. If set, the only
views in this list will be clickable. Otherwise, whole view will be
clickablepublic final void registerView(@NonNull
android.view.View view)
registerView in interface INativeAdview - Advertising viewpublic final void unregisterView()
unregisterView in interface INativeAdpublic void useExoPlayer(boolean useExoPlayer)
useExoPlayer - flag to use ExoPlayerpublic void handleData(@NonNull
java.lang.String data)
handleData in interface INativeAddata - s2s datapublic boolean isUseExoPlayer()
@Nullable public java.lang.String getAdSource()
public float getAdSourcePriority()
@Nullable public NativeAd.NativeAdMediaListener getMediaListener()
NativeAd.NativeAdMediaListenerpublic void setMediaListener(@Nullable
NativeAd.NativeAdMediaListener mediaListener)
mediaListener - listener objectNativeAd.NativeAdMediaListener