public class DFPBannerEventHandler
extends com.pubmatic.sdk.openwrap.banner.POBBannerEvent
implements com.google.android.gms.ads.admanager.AppEventListener
Modifier and Type | Class and Description |
---|---|
static interface |
DFPBannerEventHandler.DFPConfigListener
Interface to get the GAM view and it's request builder, to configure the properties.
|
Constructor and Description |
---|
DFPBannerEventHandler(Context context,
java.lang.String adUnitId,
com.google.android.gms.ads.AdSize... gamAdSizes)
Constructor to initialise GAM AdView with required properties.
|
DFPBannerEventHandler(Context context,
java.lang.String adUnitId,
com.google.android.gms.ads.AdSize gamAdSize,
POBAdSize[] owAdSizes)
Constructs an event handler instance with GAM ad unit and ad size.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
OpenWrap SDK calls this method to perform any final cleanup.
|
View |
getAdServerView()
To retrieve ad server ad view
|
POBAdSize |
getAdSize()
OpenWrap SDK calls this method to get the size of the ad rendered by the ad server SDK
|
void |
onAppEvent(java.lang.String key,
java.lang.String bidId) |
void |
requestAd(POBBid bid)
OpenWrap SDK calls this method to make a request to primary SDK.
|
POBAdSize[] |
requestedAdSizes()
OpenWrap SDK calls this method to get the size for which ad request should be made.
|
void |
setAppEventListener(GAMAppEventListener listener)
Sets the App event listener object.
|
void |
setConfigListener(DFPBannerEventHandler.DFPConfigListener listener)
Sets the Data listener object.
|
void |
setEventListener(com.pubmatic.sdk.openwrap.banner.POBBannerEventListener eventListener)
OpenWrap SDK calls this method to set POBBannerEventListener, so OpenWrap custom event handler
can inform the OpenWrap SDK about the events related to the ad server communication.
|
void |
setGAMAdSizes(com.google.android.gms.ads.AdSize... gamAdSizes)
Optional API can be used to set multiple ad sizes to
AdManagerAdView using AdManagerAdView.setAdSizes(AdSize...) internally. |
public DFPBannerEventHandler(@NonNull Context context, @NonNull java.lang.String adUnitId, @NonNull com.google.android.gms.ads.AdSize... gamAdSizes)
context
- Activity / App contextadUnitId
- GAM ad unit IDgamAdSizes
- valid ad sizes for bannerpublic DFPBannerEventHandler(@NonNull Context context, @NonNull java.lang.String adUnitId, @NonNull com.google.android.gms.ads.AdSize gamAdSize, @NonNull POBAdSize[] owAdSizes)
context
- the activity contextadUnitId
- the GAM AdUnit IdgamAdSize
- the GAM AdSize, to be used for GAM ad request. You may also use an adaptive size here..owAdSizes
- the array of OpenWrap SDK ad sizes, to be used for OpenWrap ad requests.public void setGAMAdSizes(@NonNull com.google.android.gms.ads.AdSize... gamAdSizes)
AdManagerAdView
using AdManagerAdView.setAdSizes(AdSize...)
internally.
Note: In case of Empty or Null AdSizes, the changes won't be applied to AdManagerAdView
public void setConfigListener(@Nullable DFPBannerEventHandler.DFPConfigListener listener)
listener
- DFP data listenerpublic void setAppEventListener(@Nullable GAMAppEventListener listener)
listener
- DFP app event listenerpublic void requestAd(@Nullable POBBid bid)
com.pubmatic.sdk.openwrap.core.POBBaseEvent
requestAd
in class com.pubmatic.sdk.openwrap.core.POBBaseEvent
bid
- winning bid for the requested impressionpublic void destroy()
com.pubmatic.sdk.openwrap.core.POBBaseEvent
destroy
in class com.pubmatic.sdk.openwrap.core.POBBaseEvent
public void setEventListener(@Nullable com.pubmatic.sdk.openwrap.banner.POBBannerEventListener eventListener)
com.pubmatic.sdk.openwrap.banner.POBBannerEvent
Save the `listener` to use it in later phases of ad server events execution
setEventListener
in class com.pubmatic.sdk.openwrap.banner.POBBannerEvent
eventListener
- object conforming to POBBannerEventListener@Nullable public POBAdSize getAdSize()
com.pubmatic.sdk.openwrap.banner.POBBannerEvent
getAdSize
in class com.pubmatic.sdk.openwrap.banner.POBBannerEvent
@Nullable public POBAdSize[] requestedAdSizes()
com.pubmatic.sdk.openwrap.banner.POBBannerEvent
requestedAdSizes
in class com.pubmatic.sdk.openwrap.banner.POBBannerEvent
@Nullable public View getAdServerView()
com.pubmatic.sdk.openwrap.banner.POBBannerEvent
getAdServerView
in class com.pubmatic.sdk.openwrap.banner.POBBannerEvent
public void onAppEvent(@NonNull java.lang.String key, @NonNull java.lang.String bidId)
onAppEvent
in interface com.google.android.gms.ads.admanager.AppEventListener