Skip to content

XMediator::Api::InterstitialAds

This class is the entry point for displaying interstitial ads. More...

Public Events

Name
Action< string, LoadResult > OnLoaded()
Notifies when an interstitial ad was loaded successfully, containing a LoadResult object.
Action< string > OnShowed()
Notifies when an interstitial ad was shown.
Action< string, ImpressionData > OnImpression()
Notifies when an interstitial ad impression was recorded, containing an ImpressionData object.
Action< string > OnDismissed()
Notifies when an interstitial ad was dismissed.
Action< string, ShowError > OnFailedToShow()
Notifies when an interstitial ad failed to show, containing a ShowError object describing the error.
Action< string > OnClicked()
Notifies when an interstitial ad was clicked.

Public Functions

Name
void Load(string placementId)
Starts loading a new interstitial ad.
bool IsReady(string placementId)
Indicates if an interstitial ad for the placement id is ready to be shown.
bool IsReady()
Indicates if there is an interstitial ad ready to be shown for any placement id.
void Show()
Shows a previously loaded interstitial ad for any placementId.
void Show(string placementId)
Shows a previously loaded interstitial ad for the specified placementId.
void ShowFromAdSpace(string adSpace)
Shows a previously loaded interstitial ad for any placementId.
void ShowFromAdSpace(string placementId, string adSpace)
Shows a previously loaded interstitial ad for the specified placementId.

Detailed Description

class XMediator::Api::InterstitialAds;

This class is the entry point for displaying interstitial ads.

To start, load an interstitial ad by providing a valid placement id in the Load method.

Note: Only one call to interstitial load per placement id is needed. Subsequent calls with the same placement id will be ignored.

Public Events Documentation

event OnLoaded

Action< string, LoadResult > OnLoaded()

Notifies when an interstitial ad was loaded successfully, containing a LoadResult object.

event OnShowed

Action< string > OnShowed()

Notifies when an interstitial ad was shown.

event OnImpression

Action< string, ImpressionData > OnImpression()

Notifies when an interstitial ad impression was recorded, containing an ImpressionData object.

event OnDismissed

Action< string > OnDismissed()

Notifies when an interstitial ad was dismissed.

event OnFailedToShow

Action< string, ShowError > OnFailedToShow()

Notifies when an interstitial ad failed to show, containing a ShowError object describing the error.

event OnClicked

Action< string > OnClicked()

Notifies when an interstitial ad was clicked.

Public Functions Documentation

function Load

void Load(
    string placementId
)

Starts loading a new interstitial ad.

Parameters:

  • placementId The placement id of the ad to be loaded.

After the first call, no more calls to this method are needed, as the ad will reload automatically.

function IsReady

bool IsReady(
    string placementId
)

Indicates if an interstitial ad for the placement id is ready to be shown.

Parameters:

  • placementId The placement id of the ad.

Return: true if an ad is ready to be shown.

function IsReady

bool IsReady()

Indicates if there is an interstitial ad ready to be shown for any placement id.

Return: true if an ad is ready to be shown.

function Show

void Show()

Shows a previously loaded interstitial ad for any placementId.

If multiple ads with different placement ids were previously loaded, the sdk will try to present the best one available.

function Show

void Show(
    string placementId
)

Shows a previously loaded interstitial ad for the specified placementId.

Parameters:

  • placementId The placementId of the ad.

function ShowFromAdSpace

void ShowFromAdSpace(
    string adSpace
)

Shows a previously loaded interstitial ad for any placementId.

Parameters:

  • adSpace The space in your app from where the ad will be shown (eg: dashboard, settings). Used for tracking.

If multiple ads with different placement ids were previously loaded, the sdk will try to present the best one available.

function ShowFromAdSpace

void ShowFromAdSpace(
    string placementId,
    string adSpace
)

Shows a previously loaded interstitial ad for the specified placementId.

Parameters:

  • placementId The placementId of the ad.
  • adSpace The space in your app from where the ad will be shown (eg: dashboard, settings). Used for tracking.

Updated on 2024-10-03 at 21:09:07 +0000