public class POBNativeAdLoader extends java.lang.Object implements com.pubmatic.sdk.openwrap.core.POBBaseAd, POBNativeAdManager.POBNativeAdManagerListener
This class also interacts with primary ad server for header bidding via event handler if specified.
| Constructor and Description |
|---|
POBNativeAdLoader(android.content.Context context,
java.lang.String publisherId,
int profileId,
java.lang.String adUnitId,
POBNativeTemplateType templateType)
Initializes & returns a newly allocated ad loader object for supporting 'No Ad Server Configuration'.
|
POBNativeAdLoader(android.content.Context context,
java.lang.String publisherId,
int profileId,
java.lang.String adUnitId,
POBNativeTemplateType templateType,
POBNativeAdEvent eventHandler)
Initializes & returns a newly allocated ad loader object for supporting 'Header Bidding Configuration'.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
com.pubmatic.sdk.openwrap.core.POBRequest |
getAdRequest()
Returns an instance of POBRequest, required for setting targeting parameters.
|
POBNativeAdLoaderConfig |
getConfig()
Returns the Instance of the Ad Loader config class which publisher can use to pass any
custom properties such as ContextType, ContextSubType, PlacementType etc.
|
com.pubmatic.sdk.openwrap.core.POBImpression |
getImpression()
Returns an instance of POBImpression which gets created internally.
|
void |
loadAd()
Initiate the loading for the Native ad
|
void |
onAdReceived(POBNativeAdManager adManager,
POBNativeAd nativeAd)
Notifies the callback that an Native Ad has been successfully loaded.
|
void |
onFailedToLoad(POBNativeAdManager adManager,
com.pubmatic.sdk.common.POBError error)
Notifies the callback of an error encountered while loading an adManager.
|
void |
setAdLoaderListener(POBNativeAdLoaderListener adLoaderListener)
Sets the POBNativeAdLoaderListener receiver for the ad loader events.
|
public POBNativeAdLoader(@NonNull
android.content.Context context,
@NonNull
java.lang.String publisherId,
int profileId,
@NonNull
java.lang.String adUnitId,
@NonNull
POBNativeTemplateType templateType,
@NonNull
POBNativeAdEvent eventHandler)
publisherId - Unique identifier assigned at the time of publisher on-boarding.profileId - Profile id of the ad tag.adUnitId - Ad unit id used to identify unique placement on screen.templateType - Instance of POBNativeTemplateType
any custom properties such as ContextType, ContextSubType, placementType etc.eventHandler - Instance of POBNativeAdEvent or its subclasspublic POBNativeAdLoader(@NonNull
android.content.Context context,
@NonNull
java.lang.String publisherId,
int profileId,
@NonNull
java.lang.String adUnitId,
@NonNull
POBNativeTemplateType templateType)
publisherId - Unique identifier assigned at the time of publisher on-boarding.profileId - Profile id of the ad tag.adUnitId - Ad unit id used to identify unique placement on screen.templateType - Instance of POBNativeTemplateTypepublic void setAdLoaderListener(@Nullable
POBNativeAdLoaderListener adLoaderListener)
adLoaderListener - Instance of POBNativeAdLoaderListener@Nullable public POBNativeAdLoaderConfig getConfig()
@RequiresPermission(value="android.permission.INTERNET") public void loadAd()
loadAd in interface com.pubmatic.sdk.openwrap.core.POBBaseAd@Nullable public com.pubmatic.sdk.openwrap.core.POBImpression getImpression()
getImpression in interface com.pubmatic.sdk.openwrap.core.POBBaseAd@Nullable public com.pubmatic.sdk.openwrap.core.POBRequest getAdRequest()
getAdRequest in interface com.pubmatic.sdk.openwrap.core.POBBaseAdpublic void destroy()
destroy in interface com.pubmatic.sdk.openwrap.core.POBBaseAdpublic void onAdReceived(@NonNull
POBNativeAdManager adManager,
@NonNull
POBNativeAd nativeAd)
POBNativeAdManager.POBNativeAdManagerListeneronAdReceived in interface POBNativeAdManager.POBNativeAdManagerListeneradManager - Instance of POBNativeAdManager over which native ad is loadednativeAd - the newly loaded instance of POBNativeAdpublic void onFailedToLoad(@NonNull
POBNativeAdManager adManager,
@NonNull
com.pubmatic.sdk.common.POBError error)
POBNativeAdManager.POBNativeAdManagerListeneronFailedToLoad in interface POBNativeAdManager.POBNativeAdManagerListeneradManager - Instance of POBNativeAdManager over which native adManager is loadederror - The error encountered while attempting to load the native ad.