public class GAMNativeEventHandler
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
GAMNativeEventHandler.NativeAdListener or GAMNativeEventHandler.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: https://developers.google.com/ad-manager/mobile-ads-sdk/android/native-banner
| Modifier and Type | Class and Description |
|---|---|
static interface |
GAMNativeEventHandler.GAMConfigListener
Interface to get the GAM Banner request builder, to configure the properties.
|
static class |
GAMNativeEventHandler.NativeAdListener
Interface definition to provide the NativeAd event callback
|
static class |
GAMNativeEventHandler.NativeCustomFormatAdListener
Interface definition to provide the NativeCustomFormatAd event callback
|
| Constructor and Description |
|---|
GAMNativeEventHandler(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(GAMNativeEventHandler.NativeAdListener nativeAdListener)
Prepares handler to request GAM's NativeAd by setting up
GAMNativeEventHandler.NativeAdListener. |
void |
configureNativeCustomFormatAd(java.lang.String customFormatId,
GAMNativeEventHandler.NativeCustomFormatAdListener nativeCustomFormatAdListener,
com.google.android.gms.ads.nativead.NativeCustomFormatAd.OnCustomClickListener nativeCustomFormatClickListener)
Prepares handler to request GAM's NativeCustomFormatAd by setting up
GAMNativeEventHandler.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(GAMNativeEventHandler.GAMConfigListener configListener)
Use this method to set
GAMNativeEventHandler.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 GAMNativeEventHandler(@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
GAMNativeEventHandler.NativeAdListener nativeAdListener)
GAMNativeEventHandler.NativeAdListener.nativeAdListener - an instance of GAMNativeEventHandler.NativeAdListenerpublic void configureNativeCustomFormatAd(@Nullable
java.lang.String customFormatId,
@Nullable
GAMNativeEventHandler.NativeCustomFormatAdListener nativeCustomFormatAdListener,
@Nullable
com.google.android.gms.ads.nativead.NativeCustomFormatAd.OnCustomClickListener nativeCustomFormatClickListener)
GAMNativeEventHandler.NativeCustomFormatAdListener.customFormatId - Custom format ID defined in the Ad Manager UInativeCustomFormatAdListener - an instance of GAMNativeEventHandler.NativeCustomFormatAdListenernativeCustomFormatClickListener - an instance GAM's NativeCustomFormatAd.OnCustomClickListener, please refer the custom
click behaviour @ https://developers.google.com/ad-manager/mobile-ads-sdk/android/native/custom-formats#respond_to_custom_click_actionspublic 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
GAMNativeEventHandler.GAMConfigListener configListener)
GAMNativeEventHandler.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