Interface IViewabilityManager
-
- All Implemented Interfaces:
public interface IViewabilityManagerSpecialized interface for viewability management with registration-based tracking.
This interface provides a simplified contract for viewability systems that use a registration pattern rather than explicit start/pause/resume lifecycle management. It's designed for scenarios where viewability tracking is initiated through registration and managed through a single destroy operation.
The interface emits Unit events through the flow, indicating that viewability criteria have been met without carrying additional event data. This makes it suitable for simple viewability detection where only the occurrence of viewability is important, not additional metrics or data.
This pattern is commonly used in ad systems where viewability detection triggers impression counting or other billing-related events.
-
-
Method Summary
Modifier and Type Method Description abstract Flow<Unit>registerForTracking()Registers for viewability tracking and returns a flow of viewability events. abstract Unitdestroy()Destroys the viewability manager and releases all associated resources. -
-
Method Detail
-
registerForTracking
abstract 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
abstract 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.
-
-
-
-