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.
-
-
Constructor Summary
Constructors Constructor Description NativeFailedState(Short errorCode, InMobiAdRequestStatus status, NativeAdUnitComponent nativeAdUnitComponent, NativeAdUnitStateMachine stateMachine)
-
Method Summary
Modifier and Type Method Description Unitinitialize()Initializes the failed state by notifying the callback about the loading failure. UnitonDestroy()Called when an ad unit is being destroyed and requires cleanup. -
-
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.
-
-
-
-