Class NativeLoadingState

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

    
    public final class NativeLoadingState
    extends AdComponentWrapper implements State, AUDestroyListener
                        

    Represents the loading state of a native ad unit. This state handles the inflation process including OM-SDK initialization, media view loading, ad choice view creation, and beacon processor setup. It transitions to either loaded state on success or failed state on error.

    • Constructor Detail

      • NativeLoadingState

        NativeLoadingState(NativeAdUnitComponent nativeAdUnitComponent, NativeAdUnitStateMachine stateMachine)
        Parameters:
        nativeAdUnitComponent - The dependency injection component providing core dependencies.
        stateMachine - The state machine managing the lifecycle transitions.
    • Method Detail

      • initialize

         Unit initialize()

        Initializes the loading state by starting the ad inflation process.

      • onDestroy

         Unit onDestroy()

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

      • cleanUp

         Unit cleanUp()

        Finalizes the loading state by cleaning up resources and canceling ongoing operations. This method cancels the state scope to prevent memory leaks and stop any running coroutines.