Class NativeFailedState

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

    
    public final class NativeFailedState
     implements State, AUDestroyListener
                        

    Represents the failed state of a native ad unit. This state is reached when the native ad loading or inflation process encounters an error. It notifies the callback about the failure and provides error details.

    • 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 initialize() Initializes the failed state by notifying the callback about the loading failure.
      Unit onDestroy() Called when an ad unit is being destroyed and requires cleanup.
      • Methods inherited from class com.inmobi.media.ads.common.base.state.State

        cleanUp
      • Methods inherited from class java.lang.Object

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

      • NativeFailedState

        NativeFailedState(Short errorCode, InMobiAdRequestStatus status, NativeAdUnitComponent nativeAdUnitComponent, NativeAdUnitStateMachine stateMachine)
        Parameters:
        errorCode - The specific error code indicating the type of failure.
        status - The InMobiAdRequestStatus containing detailed error information.
        nativeAdUnitComponent - The dependency injection component providing core dependencies.
        stateMachine - The state machine managing the lifecycle transitions.
    • Method Detail

      • initialize

         Unit initialize()

        Initializes the failed state by notifying the callback about the loading failure.

      • onDestroy

         Unit onDestroy()

        Called when an ad unit is being destroyed and requires cleanup.

        This method is invoked when the ad unit lifecycle is ending and all associated resources should be released. The method is suspending to allow for asynchronous cleanup operations such as cancelling coroutines, releasing network connections, or performing database cleanup. Implementers should ensure all resources are properly cleaned up to prevent memory leaks.