Package 

Class InterstitialLoader


  • 
    public final class InterstitialLoader
    
                        

    Responsible for rendering and displaying popup-style ads (image/video).

    • 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.
      • showPopup

         final Unit showPopup(Context context, BaseAd ad, String cliUbid, Integer height, Integer width, Integer alignment, Coordinates coordinates, Boolean isClamped, Function1<Map<String, Object>, Unit> adClickListener, 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.