-
public final class InterstitialLoaderResponsible for rendering and displaying popup-style ads (image/video).
-
-
Constructor Summary
Constructors Constructor Description InterstitialLoader(CoroutineScope coroutineScope, AdTrackerInterface adTracker)
-
Method Summary
Modifier and Type Method Description final UnitsetErrorCallback(ErrorCallback callback)Set an error callback to handle errors that occur during interstitial ad loading or playback. final UnitclearErrorCallback()Clear the error callback to prevent memory leaks. final UnitshowPopup(Context context, BaseAd ad, String cliUbid, Integer height, Integer width, Integer alignment, Coordinates coordinates, Boolean isClamped, String adLabelText, Integer adLabelAlignment, Function1<Map<String, Object>, Unit> adClickListener, Function2<Map<String, Object>, String, Unit> onViewLoadListener, Integer closeButtonSec)Displays a popup dialog containing the given ad content. final Unitcleanup()-
-
Constructor Detail
-
InterstitialLoader
InterstitialLoader(CoroutineScope coroutineScope, AdTrackerInterface adTracker)
-
-
Method Detail
-
setErrorCallback
final Unit setErrorCallback(ErrorCallback callback)
Set an error callback to handle errors that occur during interstitial ad loading or playback.
- Parameters:
callback- Callback that handles error scenarios with structured error information.
-
clearErrorCallback
final Unit clearErrorCallback()
Clear the error callback to prevent memory leaks.
-
showPopup
final Unit showPopup(Context context, BaseAd ad, String cliUbid, Integer height, Integer width, Integer alignment, Coordinates coordinates, Boolean isClamped, String adLabelText, Integer adLabelAlignment, Function1<Map<String, Object>, Unit> adClickListener, Function2<Map<String, Object>, String, Unit> onViewLoadListener, Integer closeButtonSec)
Displays a popup dialog containing the given ad content.
This function is responsible for showing a popup (image or video ad) in the given context. The ad can be positioned either by gravity (e.g., "CENTER", "BOTTOM") or using absolute (x, y) coordinates.
- Parameters:
context- The Android context used for creating views and dialogs.ad- The BaseAd to be rendered in the popup.cliUbid- The cli_ubid used for tracking impressions and ad clicks.height- Optional height for the popup content.width- Optional width for the popup content.alignment- Optional alignment string ("CENTER" or "BOTTOM") used to position the popup within the available space.coordinates- Optional object containing the X and Y coordinates for absolute positioning of the popup.adClickListener- Optional listener that is triggered when the ad is clicked.closeButtonSec- Optional duration (in seconds) for when the close button will be visible.
-
-
-
-