Class MyTargetNativeAdAdapter

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      void destroy() Destroys adapter and cleans resources.
      View getMediaView(@NonNull() Context context) Must return view for displaying media view (large picture or video) for correct implementation of Native Ads and tracking.
      void handleAdChoicesClick(@NonNull() Context context) Method for processing click on adChoices
      void handleClick(boolean isCta, @NonNull() View view) Method for processing click on native ad views
      void load(@NonNull() MediationNativeAdConfig mediationAdConfig, @NonNull() MediationNativeAdAdapter.MediationNativeAdListener listener, @NonNull() Context context) Will be called when mediation choose this adapter for loading mediation.
      void registerView(@NonNull() View view, @Nullable() List<View> clickableViews, int adChoicesPlacement) Will be called when view becomes ready to be shown.
      void registerView(@NonNull() NativeAdViewBinder nativeAdViewBinder, @Nullable() List<View> clickableViews, int adChoicesPlacement) Will be called when view becomes ready to be shown.
      void unregisterView() Will be called when view appears invisible and unused.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MyTargetNativeAdAdapter

        MyTargetNativeAdAdapter()
    • Method Detail

      • destroy

         void destroy()

        Destroys adapter and cleans resources. Adapter will not work after calling this method

      • getMediaView

        @Nullable() View getMediaView(@NonNull() Context context)

        Must return view for displaying media view (large picture or video) for correct implementation of Native Ads and tracking. It is optional, but preferred.

        Parameters:
        context - app context
        Returns:

        View for Media

      • handleAdChoicesClick

         void handleAdChoicesClick(@NonNull() Context context)

        Method for processing click on adChoices

      • handleClick

         void handleClick(boolean isCta, @NonNull() View view)

        Method for processing click on native ad views

      • registerView

        @Deprecated() void registerView(@NonNull() View view, @Nullable() List<View> clickableViews, int adChoicesPlacement)

        Will 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

        Parameters:
        adChoicesPlacement - Value is TOP_RIGHT, TOP_LEFT, BOTTOM_RIGHT, BOTTOM_LEFT, MANUAL, or DRAWING_MANUAL
      • registerView

         void registerView(@NonNull() NativeAdViewBinder nativeAdViewBinder, @Nullable() List<View> clickableViews, int adChoicesPlacement)

        Will 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

        Parameters:
        nativeAdViewBinder - is binder for views to be registered
        clickableViews - optional views want to be clickable
        adChoicesPlacement - placement of AdChoices icon.
      • unregisterView

         void unregisterView()

        Will be called when view appears invisible and unused. There must be called apis to stop tracking views and free resources.