Package com.my.target.mediation
Class MyTargetNativeBannerAdAdapter
java.lang.Object
com.my.target.mediation.MyTargetNativeBannerAdAdapter
- All Implemented Interfaces:
AdChoicesClickHandler,MediationAdapter,MediationNativeBannerAdAdapter
public final class MyTargetNativeBannerAdAdapter
extends Object
implements MediationNativeBannerAdAdapter, AdChoicesClickHandler
An adapter for internal mediation
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.my.target.mediation.MediationNativeBannerAdAdapter
MediationNativeBannerAdAdapter.MediationNativeBannerAdListener -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Destroys adapter and cleans resources.android.view.ViewgetIconView(android.content.Context context) Must return view for displaying icon view for correct implementation of Native Ads and tracking.voidhandleAdChoicesClick(android.content.Context context) Method for processing click on adChoicesvoidload(MediationNativeBannerAdConfig mediationAdConfig, MediationNativeBannerAdAdapter.MediationNativeBannerAdListener listener, android.content.Context context) Will be called when mediation choose this adapter for loading mediation.voidregisterView(android.view.View view, List<android.view.View> clickableViews, int adChoicesPlacement) Will be called when view becomes ready to be shown.voidsetSection(NativeAdSection section) voidWill be called when view appears invisible and unused.
-
Constructor Details
-
MyTargetNativeBannerAdAdapter
public MyTargetNativeBannerAdAdapter()
-
-
Method Details
-
setSection
public void setSection(@Nullable NativeAdSection section) -
load
public void load(@NonNull MediationNativeBannerAdConfig mediationAdConfig, @NonNull MediationNativeBannerAdAdapter.MediationNativeBannerAdListener listener, @NonNull android.content.Context context) Description copied from interface:MediationNativeBannerAdAdapterWill be called when mediation choose this adapter for loading mediation. All of initialization and loading logic should be implemented here. After successful loading should be createdcom.my.target.core.models.banners.NativeAdBannerfrom received assets and then should be calledMediationNativeBannerAdAdapter.MediationNativeBannerAdListener.onLoad(NativeBanner, MediationNativeBannerAdAdapter)in case of failed loading should be calledMediationNativeBannerAdAdapter.MediationNativeBannerAdListener.onNoAd(IAdLoadingError, MediationNativeBannerAdAdapter)with the reason of fail. If no callbacks will be called, adapter will be removed from loading queue, and next adapter or no ad will be called.- Specified by:
loadin interfaceMediationNativeBannerAdAdapter- Parameters:
mediationAdConfig- contains main configuration for mediationlistener- main mediation listenercontext- app context- See Also:
-
registerView
public void registerView(@NonNull android.view.View view, @Nullable List<android.view.View> clickableViews, int adChoicesPlacement) Description copied from interface:MediationNativeBannerAdAdapterWill be called when view becomes ready to be shown. There must be called apis to start tracking views, adding listeners on views and load resources, which was not loaded previously, such as not pre-loaded media content. Clickable views is optional, if set - click listeners must be placed only on views in this list, otherwise must be used default logic of ad network- Specified by:
registerViewin interfaceMediationNativeBannerAdAdapter- Parameters:
view- view to be registeredclickableViews- optional views want to be clickableadChoicesPlacement- placement of AdChoices icon. Possible values inAdChoicesPlacement
-
unregisterView
public void unregisterView()Description copied from interface:MediationNativeBannerAdAdapterWill be called when view appears invisible and unused. There must be called apis to stop tracking views and free resources.- Specified by:
unregisterViewin interfaceMediationNativeBannerAdAdapter
-
getIconView
@Nullable public android.view.View getIconView(@NonNull android.content.Context context) Description copied from interface:MediationNativeBannerAdAdapterMust return view for displaying icon view for correct implementation of Native Ads and tracking. It is optional, but preferred.- Specified by:
getIconViewin interfaceMediationNativeBannerAdAdapter- Parameters:
context- app context- Returns:
- View for Icon
-
destroy
public void destroy()Description copied from interface:MediationAdapterDestroys adapter and cleans resources. Adapter will not work after calling this method- Specified by:
destroyin interfaceMediationAdapter
-
handleAdChoicesClick
public void handleAdChoicesClick(@NonNull android.content.Context context) Description copied from interface:AdChoicesClickHandlerMethod for processing click on adChoices- Specified by:
handleAdChoicesClickin interfaceAdChoicesClickHandler
-