Class NativeLoadedState

  • All Implemented Interfaces:
    com.inmobi.media.ads.common.base.state.State , com.inmobi.media.ads.common.listeners.AUDestroyListener , com.inmobi.media.ads.nativeAd.listeners.RegisterTrackingListener

    
    public final class NativeLoadedState
    extends AdComponentWrapper implements State, RegisterTrackingListener, AUDestroyListener
                        

    Represents the loaded state of a native ad unit. This state is reached when the native ad has been successfully loaded and inflated. It provides the native ad data to the publisher and waits for view registration before transitioning to the rendered state.

    • Constructor Detail

      • NativeLoadedState

        NativeLoadedState(MediaView mediaView, View adChoice, AdSessionManager adSessionManager, NativeBeaconProcessor nativeBeaconProcessor, NativeAdUnitComponent nativeAdUnitComponent, NativeAdUnitStateMachine stateMachine)
        Parameters:
        mediaView - The media view containing video or image content, if available.
        adChoice - The ad choice view for privacy controls, if available.
        adSessionManager - The OM-SDK ad session manager for viewability tracking.
        nativeBeaconProcessor - The beacon processor for tracking ad events.
        nativeAdUnitComponent - The dependency injection component providing core dependencies.
        stateMachine - The state machine managing the lifecycle transitions.
    • Method Detail

      • initialize

         Unit initialize()

        Initializes the loaded state by preparing native ad data and notifying the callback.

      • registerViewForTracking

         Unit registerViewForTracking(InMobiNativeViewData inMobiNativeViewData)

        Registers the provided view data for tracking and transitions to the rendered state. This method is called when the publisher provides the views for impression and click tracking.

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

         Unit onDestroy()

        Handles the destruction of the loaded state. This method transitions the state machine to the destroyed state and performs cleanup.