Class LoadResponseState

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

    
    public abstract class LoadResponseState
    extends AdManagerComponentWrapper implements State, InternalLoadTimeoutListener, AUMDestroyListener
                        

    Represents the state when processing a pre-existing ad response for loading.

    This abstract state handles the processing of ad response data that was provided directly rather than fetched from the server. It validates the response data, processes it using ABAdResponseManager, and handles various failure scenarios. The state manages timeout events and coordinates with AdFetchEventHelper to track processing events. Upon successful processing, it transitions to the next appropriate state, while failures result in transitions to failed states.

    • Method Detail

      • initialize

         Unit initialize()

        Initializes the load response state and begins processing the ad response.

        This method validates the response data and processes it using ABAdResponseManager. If the response is null or empty, it immediately fails. Otherwise, it processes the response asynchronously, handling both successful parsing and various failure scenarios through exception handling.

      • cleanUp

         Unit cleanUp()

        Finalizes the state and cancels the child coroutine scope.

      • onInternalLoadTimeout

         Unit onInternalLoadTimeout()

        Handles internal load timeout events during response processing.

        This method transitions to FetchFailedState with timeout error codes when processing takes too long.