public class POBNativeAdProvider extends java.lang.Object implements POBNativeAd, POBNativeRendererListener, POBNativeAdEventListener
| Constructor and Description |
|---|
POBNativeAdProvider(android.content.Context context,
POBNativeTemplateType nativeTemplateType,
POBNativeAdEventBridge adEventHandler)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Method to destroy the native ad
|
POBNativeAdView |
getAdView()
Returns the rendered Native Ad View in both OpenWrapPartnerWin and OnAdServerWin condition
Instance of
POBNativeAdView works as a wrapper around AdServerView and OpenWrap POBNativeTemplateView |
POBNativeAdDataResponseAsset |
getDataAssetForId(int assetId)
Return the data asset for the respective Id
|
POBNativeAdImageResponseAsset |
getImageAssetForId(int assetId)
Return the image asset for the respective Id
|
POBNativeAdTitleResponseAsset |
getTitleAssetForId(int assetId)
Return the title asset for the respective Id
|
void |
onAdClicked()
Notify about the Native Ad recorded click
|
void |
onAdClicked(int assetId)
Notify about the Native Ad recorded click for specific asset
|
void |
onAdClosed()
Notify about the Native Ad closed
|
void |
onAdImpression()
Notify about the Native Ad recorded impression
|
void |
onAdLeavingApplication()
Notify about the Native Ad leaving application
|
void |
onAdOpened()
Notify about the Native Ad opened
|
void |
onAdRendered(android.view.View adView)
Notify about the Native Ad rendering completion
|
void |
onAdRenderingFailed(com.pubmatic.sdk.common.POBError error)
Notify about the Native Ad rendering failure
|
void |
onDsaInfoIconClicked()
Notifies to show the DSA info detail screen
|
void |
onNativeAdClicked()
Get called when the ad server SDK informs about click event as a result of user interaction.
|
void |
onNativeAdClosed()
Get called this when the ad server SDK closed the ad
|
void |
onNativeAdImpression()
Get called when the ad server SDK informs about impression event
|
void |
onNativeAdOpened()
Get called this when the ad server SDK has opened an ad
|
void |
registerViewForInteraction(android.view.View adView,
java.util.List<android.view.View> clickableViews,
POBNativeAdListener listener)
Register's native ad view and its asset views for impression and click tracking purpose.
|
void |
renderAd(POBNativeAdListener listener)
Render the native template in
POBNativeAdView object |
void |
renderAd(POBNativeTemplateView templateView,
POBNativeAdListener listener)
Another flavor of renderAd method use by publisher to pass there own custom view template
|
void |
setBid(com.pubmatic.sdk.openwrap.core.POBBid bid)
Sets the instance of POBBid
|
void |
setNativeAdResponse(POBNativeAdResponse nativeAdResponse)
Setter for the native ad response
|
public POBNativeAdProvider(@NonNull
android.content.Context context,
@NonNull
POBNativeTemplateType nativeTemplateType,
@NonNull
POBNativeAdEventBridge adEventHandler)
context - Activity contextnativeTemplateType - Template type for Native AdadEventHandler - Instance of POBNativeAdEventpublic void setBid(@Nullable
com.pubmatic.sdk.openwrap.core.POBBid bid)
bid - Instance of POBBidpublic void setNativeAdResponse(@Nullable
POBNativeAdResponse nativeAdResponse)
nativeAdResponse - Instance of POBNativeAdResponse@MainThread
public void renderAd(@NonNull
POBNativeAdListener listener)
POBNativeAdPOBNativeAdView objectrenderAd in interface POBNativeAdlistener - POBNativeAdListener to get rendering callbacks@MainThread
public void renderAd(@NonNull
POBNativeTemplateView templateView,
@NonNull
POBNativeAdListener listener)
POBNativeAdrenderAd in interface POBNativeAdtemplateView - custom template to get populatelistener - POBNativeAdListener of rendering callbackspublic void destroy()
POBNativeAddestroy in interface POBNativeAdpublic void registerViewForInteraction(@NonNull
android.view.View adView,
@NonNull
java.util.List<android.view.View> clickableViews,
@NonNull
POBNativeAdListener listener)
POBNativeAdregisterViewForInteraction in interface POBNativeAdadView - native ad view containerclickableViews - clickable asset viewslistener - POBNativeAdListener of rendering callbacks@Nullable public POBNativeAdView getAdView()
POBNativeAdPOBNativeAdView works as a wrapper around AdServerView and OpenWrap POBNativeTemplateViewgetAdView in interface POBNativeAdPOBNativeAdView@Nullable public POBNativeAdTitleResponseAsset getTitleAssetForId(int assetId)
POBNativeAdgetTitleAssetForId in interface POBNativeAdassetId - Id of the asset.POBNativeAdTitleResponseAsset@Nullable public POBNativeAdDataResponseAsset getDataAssetForId(int assetId)
POBNativeAdgetDataAssetForId in interface POBNativeAdassetId - Id of the asset.POBNativeAdDataResponseAsset@Nullable public POBNativeAdImageResponseAsset getImageAssetForId(int assetId)
POBNativeAdgetImageAssetForId in interface POBNativeAdassetId - Id of the asset.POBNativeAdImageResponseAssetpublic void onAdRendered(@NonNull
android.view.View adView)
POBNativeRendererListeneronAdRendered in interface POBNativeRendererListeneradView - Native Ad view instancepublic void onAdRenderingFailed(@NonNull
com.pubmatic.sdk.common.POBError error)
POBNativeRendererListeneronAdRenderingFailed in interface POBNativeRendererListenererror - POBError for show failurespublic void onAdImpression()
POBNativeRendererListeneronAdImpression in interface POBNativeRendererListenerpublic void onAdClicked()
POBNativeRendererListeneronAdClicked in interface POBNativeRendererListenerpublic void onAdClicked(int assetId)
POBNativeRendererListeneronAdClicked in interface POBNativeRendererListenerpublic void onAdLeavingApplication()
POBNativeRendererListeneronAdLeavingApplication in interface POBNativeRendererListenerpublic void onAdOpened()
POBNativeRendererListeneronAdOpened in interface POBNativeRendererListenerpublic void onAdClosed()
POBNativeRendererListeneronAdClosed in interface POBNativeRendererListenerpublic void onDsaInfoIconClicked()
POBNativeRendererListeneronDsaInfoIconClicked in interface POBNativeRendererListenerpublic void onNativeAdClosed()
POBNativeAdEventListeneronNativeAdClosed in interface POBNativeAdEventListenerpublic void onNativeAdOpened()
POBNativeAdEventListeneronNativeAdOpened in interface POBNativeAdEventListenerpublic void onNativeAdClicked()
POBNativeAdEventListeneronNativeAdClicked in interface POBNativeAdEventListenerpublic void onNativeAdImpression()
POBNativeAdEventListeneronNativeAdImpression in interface POBNativeAdEventListener