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.
-
-
Constructor Summary
Constructors Constructor Description NativeAdUnitManager(Context context, PubSettings pubSettings, NativeAdUnitManagerCallback nativeCallbacks)
-
Method Summary
Modifier and Type Method Description UnitregisterViewForTracking(InMobiNativeViewData inMobiNativeViewData)Registers the provided view data for tracking impressions and clicks. UnitunTrackViews()Removes tracking from all previously registered views. final UnittakeAction()Handles user actions (such as clicks) on the native ad. StringnotifyWin(Double minBidToWin)Notify that the bid for this ad was won. StringnotifyLoss(Integer lossReason, Double auctionPrice)Notify that the bid for this ad was lost. -
-
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 auctionauctionPrice- The price of the winning bid in the auction- Returns:
An error message string if the notification failed, null if successful
-
-
-
-