Class NativeMRC50Manager
-
- All Implemented Interfaces:
-
com.inmobi.media.ads.common.viewability.interfaces.IViewabilityManager
public final class NativeMRC50Manager implements IViewabilityManager
Manager class for handling MRC 50% viewability tracking for native ads. This class serves as a facade that delegates to either a display or video-specific MRC 50% manager based on the type of ad content.
-
-
Constructor Summary
Constructors Constructor Description NativeMRC50Manager(CoroutineScope scope, MRC50Model mrC50Model, Flow<Boolean> lifecycleObserver)
-
Method Summary
Modifier and Type Method Description Flow<Unit>registerForTracking()Registers for viewability tracking and returns a flow of viewability events. Unitdestroy()Destroys the viewability manager and releases all associated resources. -
-
Constructor Detail
-
NativeMRC50Manager
NativeMRC50Manager(CoroutineScope scope, MRC50Model mrC50Model, Flow<Boolean> lifecycleObserver)
- Parameters:
scope- The coroutine scope for managing asynchronous operations.mrC50Model- The model containing MRC 50% viewability configuration.lifecycleObserver- A flow that emits the lifecycle state of the ad view.
-
-
Method Detail
-
registerForTracking
Flow<Unit> registerForTracking()
Registers for viewability tracking and returns a flow of viewability events.
This method initiates viewability tracking through a registration mechanism and returns a Flow that emits Unit events when viewability criteria are met. The registration approach implies that the tracking system manages its own lifecycle internally without requiring explicit pause/resume operations.
- Returns:
A Flow that emits Unit when viewability criteria are satisfied
-
destroy
Unit destroy()
Destroys the viewability manager and releases all associated resources.
This method terminates viewability tracking and performs complete cleanup of all resources including observers, timers, background tasks, and any registered listeners. After calling destroy, the manager should not emit further events and cannot be reused without re-instantiation.
-
-
-
-