Class NativeAdUnitManager

  • All Implemented Interfaces:
    com.inmobi.ads.core.WinLossNotifier , com.inmobi.media.ads.nativeAd.listeners.RegisterTrackingListener , com.inmobi.media.ads.nativeAd.listeners.UnTrackListener

    
    public final class NativeAdUnitManager
    extends AdUnitManager implements RegisterTrackingListener, UnTrackListener, WinLossNotifier
                        

    Manager class for native ad units, responsible for managing the lifecycle and operations of native ads. This class extends AdUnitManager to provide native ad-specific functionality.

    This manager handles ad fetching, loading, view tracking, and user interactions for native ads. It implements both RegisterTrackingListener and UnTrackListener interfaces to provide comprehensive view tracking capabilities.

    • 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
      Unit registerViewForTracking(InMobiNativeViewData inMobiNativeViewData) Registers the provided view data for tracking impressions and clicks.
      Unit unTrackViews() Removes tracking from all previously registered views.
      final Unit takeAction() Handles user actions (such as clicks) on the native ad.
      String notifyWin(Double minBidToWin) Notify that the bid for this ad was won.
      String notifyLoss(Integer lossReason, Double auctionPrice) Notify that the bid for this ad was lost.
      • Methods inherited from class com.inmobi.media.ads.common.adUnitManager.AdUnitManager

        destroy, fetch, inflate, load
      • Methods inherited from class java.lang.Object

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

      • NativeAdUnitManager

        NativeAdUnitManager(Context context, PubSettings pubSettings, NativeAdUnitManagerCallback nativeCallbacks)
        Parameters:
        context - The Android context required for ad operations.
        pubSettings - The publisher settings configuration.
        nativeCallbacks - The callback interface for native ad unit manager events.
    • Method Detail

      • registerViewForTracking

         Unit registerViewForTracking(InMobiNativeViewData inMobiNativeViewData)

        Registers the provided view data for tracking impressions and clicks.

        This method sets up tracking for all views contained in the native view data, enabling impression tracking and click handling for the native ad components.

        Parameters:
        inMobiNativeViewData - The view data containing all views that need to be tracked.
      • unTrackViews

         Unit unTrackViews()

        Removes tracking from all previously registered views.

        This method cleans up all view tracking to prevent memory leaks and stops impression/click tracking. Should be called when the native ad is no longer active.

      • takeAction

         final Unit takeAction()

        Handles user actions (such as clicks) on the native ad.

        This method processes user interactions with the native ad and triggers appropriate actions such as opening landing pages or handling deep links.

      • notifyWin

         String notifyWin(Double minBidToWin)

        Notify that the bid for this ad was won. Delegates to the state machine to handle Win beacon firing.

        Parameters:
        minBidToWin - The minimum bid amount required to win the auction
        Returns:

        An error message string if the notification failed, null if successful

      • notifyLoss

         String notifyLoss(Integer lossReason, Double auctionPrice)

        Notify that the bid for this ad was lost. Delegates to the state machine to handle Loss beacon firing.

        Parameters:
        lossReason - The reason code for losing the auction
        auctionPrice - The price of the winning bid in the auction
        Returns:

        An error message string if the notification failed, null if successful