public class GAMNativeBannerEventHandler
extends com.pubmatic.sdk.openwrap.banner.POBBannerEvent
implements com.google.android.gms.ads.admanager.AppEventListener, com.google.android.gms.ads.formats.OnAdManagerAdViewLoadedListener, com.google.android.gms.ads.nativead.NativeAd.OnNativeAdLoadedListener, com.google.android.gms.ads.nativead.NativeCustomFormatAd.OnCustomFormatAdLoadedListener
GAMNativeBannerEventHandler.NativeAdListener or GAMNativeBannerEventHandler.NativeCustomFormatAdListener
while banner ad events are provided through POBBannerViewListener as usual.
Note: You must set up banner demand, in addition to native and/or custom native, to include OW banner bids
Reference: ...
| Modifier and Type | Class and Description |
|---|---|
static class |
GAMNativeBannerEventHandler.NativeAdListener
Interface definition to provide the NativeAd event callback
|
static class |
GAMNativeBannerEventHandler.NativeCustomFormatAdListener
Interface definition to provide the NativeCustomFormatAd event callback
|
| Constructor and Description |
|---|
GAMNativeBannerEventHandler(android.content.Context context,
java.lang.String adUnitId,
com.google.android.gms.ads.AdSize... adSizes)
Constructor to initialise required properties using that Event Handler build ad request.
|
| Modifier and Type | Method and Description |
|---|---|
void |
configureNativeAd(GAMNativeBannerEventHandler.NativeAdListener nativeAdListener)
Prepares handler to request GAM's NativeAd by setting up
GAMNativeBannerEventHandler.NativeAdListener. |
void |
configureNativeCustomFormatAd(java.lang.String customFormatId,
GAMNativeBannerEventHandler.NativeCustomFormatAdListener nativeCustomFormatAdListener,
com.google.android.gms.ads.nativead.NativeCustomFormatAd.OnCustomClickListener nativeCustomFormatClickListener)
Prepares handler to request GAM's NativeCustomFormatAd by setting up
GAMNativeBannerEventHandler.NativeCustomFormatAdListener. |
void |
destroy() |
android.view.View |
getAdServerView() |
com.pubmatic.sdk.common.POBAdSize |
getAdSize() |
void |
onAdManagerAdViewLoaded(com.google.android.gms.ads.admanager.AdManagerAdView adManagerAdView) |
void |
onAppEvent(java.lang.String key,
java.lang.String bidId) |
void |
onCustomFormatAdLoaded(com.google.android.gms.ads.nativead.NativeCustomFormatAd nativeCustomFormatAd) |
void |
onNativeAdLoaded(com.google.android.gms.ads.nativead.NativeAd nativeAd) |
void |
requestAd(com.pubmatic.sdk.openwrap.core.POBBid bid) |
com.pubmatic.sdk.common.POBAdSize[] |
requestedAdSizes() |
void |
setAdManagerOptions(com.google.android.gms.ads.formats.AdManagerAdViewOptions adManagerOptions)
Sets AdManagerAdView options to use while requesting an ad using GAM AdLoader
|
void |
setAppEventListener(GAMAppEventListener listener)
Sets the App event listener object.
|
void |
setConfigListener(GAMConfigListener configListener)
Use this method to set
GAMConfigListener reference and implement its method
to set the additional targeting parameters for GAM's AdLoader. |
void |
setEventListener(com.pubmatic.sdk.openwrap.banner.POBBannerEventListener listener) |
void |
setNativeAdOptions(com.google.android.gms.ads.nativead.NativeAdOptions nativeAdOptions)
Sets NativeAd options to use while requesting an ad using GAM AdLoader
|
public GAMNativeBannerEventHandler(@NonNull
android.content.Context context,
@NonNull
java.lang.String adUnitId,
@NonNull
com.google.android.gms.ads.AdSize... adSizes)
context - instance of application contextadUnitId - GAM ad unit idadSizes - valid ad sizes for bannerpublic void configureNativeAd(@Nullable
GAMNativeBannerEventHandler.NativeAdListener nativeAdListener)
GAMNativeBannerEventHandler.NativeAdListener.nativeAdListener - an instance of GAMNativeBannerEventHandler.NativeAdListenerpublic void configureNativeCustomFormatAd(@Nullable
java.lang.String customFormatId,
@Nullable
GAMNativeBannerEventHandler.NativeCustomFormatAdListener nativeCustomFormatAdListener,
@Nullable
com.google.android.gms.ads.nativead.NativeCustomFormatAd.OnCustomClickListener nativeCustomFormatClickListener)
GAMNativeBannerEventHandler.NativeCustomFormatAdListener.customFormatId - Custom format ID defined in the Ad Manager UInativeCustomFormatAdListener - an instance of GAMNativeBannerEventHandler.NativeCustomFormatAdListenernativeCustomFormatClickListener - an instance GAM's NativeCustomFormatAd.OnCustomClickListener, please refer the custom
click behaviour @
Respond to custom click actions public void setAdManagerOptions(@Nullable
com.google.android.gms.ads.formats.AdManagerAdViewOptions adManagerOptions)
adManagerOptions - the instance of AdManagerAdViewOptionspublic void setNativeAdOptions(@Nullable
com.google.android.gms.ads.nativead.NativeAdOptions nativeAdOptions)
nativeAdOptions - the instance of NativeAdOptionspublic void setConfigListener(@Nullable
GAMConfigListener configListener)
GAMConfigListener reference and implement its method
to set the additional targeting parameters for GAM's AdLoader.configListener - GAM data listenerpublic void setAppEventListener(@Nullable
GAMAppEventListener listener)
listener - POB app event listenerpublic void setEventListener(@NonNull
com.pubmatic.sdk.openwrap.banner.POBBannerEventListener listener)
setEventListener in class com.pubmatic.sdk.openwrap.banner.POBBannerEvent@Nullable public com.pubmatic.sdk.common.POBAdSize getAdSize()
getAdSize in class com.pubmatic.sdk.openwrap.banner.POBBannerEvent@Nullable public com.pubmatic.sdk.common.POBAdSize[] requestedAdSizes()
requestedAdSizes in class com.pubmatic.sdk.openwrap.banner.POBBannerEvent@Nullable public android.view.View getAdServerView()
getAdServerView in class com.pubmatic.sdk.openwrap.banner.POBBannerEventpublic void requestAd(@Nullable
com.pubmatic.sdk.openwrap.core.POBBid bid)
requestAd in class com.pubmatic.sdk.openwrap.core.POBBaseEventpublic void destroy()
destroy in class com.pubmatic.sdk.openwrap.core.POBBaseEventpublic void onAppEvent(@NonNull
java.lang.String key,
@NonNull
java.lang.String bidId)
onAppEvent in interface com.google.android.gms.ads.admanager.AppEventListenerpublic void onAdManagerAdViewLoaded(@NonNull
com.google.android.gms.ads.admanager.AdManagerAdView adManagerAdView)
onAdManagerAdViewLoaded in interface com.google.android.gms.ads.formats.OnAdManagerAdViewLoadedListenerpublic void onNativeAdLoaded(@NonNull
com.google.android.gms.ads.nativead.NativeAd nativeAd)
onNativeAdLoaded in interface com.google.android.gms.ads.nativead.NativeAd.OnNativeAdLoadedListenerpublic void onCustomFormatAdLoaded(@NonNull
com.google.android.gms.ads.nativead.NativeCustomFormatAd nativeCustomFormatAd)
onCustomFormatAdLoaded in interface com.google.android.gms.ads.nativead.NativeCustomFormatAd.OnCustomFormatAdLoadedListener