Class InterstitialAd
Class to be instantiated in order to show an Interstitial Ad.
Inherited Members
Namespace: Unity.Services.Mediation
Assembly: Unity.Mediation.dll
Syntax
public sealed class InterstitialAd : IInterstitialAd, IDisposable
Constructors
InterstitialAd(string)
Constructor for managing a specific Interstitial Ad.
Declaration
public InterstitialAd(string adUnitId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | adUnitId | Unique Id for the Ad you want to show. |
Properties
AdState
Get the current state of the ad.
Declaration
public AdState AdState { get; }
Property Value
| Type | Description |
|---|---|
| AdState |
AdUnitId
Get the ad unit id set during construction.
Declaration
public string AdUnitId { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
Dispose()
Dispose and release internal resources.
Declaration
public void Dispose()
LoadAsync()
Method to tell the Mediation SDK to load an Ad.
Declaration
public Task LoadAsync()
Returns
| Type | Description |
|---|---|
| Task | LoadAsync Task |
Exceptions
| Type | Condition |
|---|---|
| LoadFailedException | Thrown when the ad failed to load |
ShowAsync(InterstitialAdShowOptions)
Method to tell the Mediation SDK to show the loaded Ad.
Declaration
public Task ShowAsync(InterstitialAdShowOptions showOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| InterstitialAdShowOptions | showOptions | Optional, allows setting optional parameters for showing an interstitial ad. |
Returns
| Type | Description |
|---|---|
| Task | ShowAsync Task |
Exceptions
| Type | Condition |
|---|---|
| ShowFailedException | Thrown when the ad failed to show |
Events
OnClicked
Event to be triggered by the adapter when the user clicks on the Ad.
Declaration
public event EventHandler OnClicked
Event Type
| Type | Description |
|---|---|
| EventHandler |
OnClosed
Event to be triggered by the adapter when the Ad is closed.
Declaration
public event EventHandler OnClosed
Event Type
| Type | Description |
|---|---|
| EventHandler |
OnFailedLoad
Event to be triggered by the adapter when an Ad fails to load.
Declaration
public event EventHandler<LoadErrorEventArgs> OnFailedLoad
Event Type
| Type | Description |
|---|---|
| EventHandler<LoadErrorEventArgs> |
OnFailedShow
Event to be triggered by the adapter when the Ad has an error.
Declaration
public event EventHandler<ShowErrorEventArgs> OnFailedShow
Event Type
| Type | Description |
|---|---|
| EventHandler<ShowErrorEventArgs> |
OnLoaded
Event to be triggered by the adapter when an Ad is loaded.
Declaration
public event EventHandler OnLoaded
Event Type
| Type | Description |
|---|---|
| EventHandler |
OnShowed
Event to be triggered by the adapter when an Ad is started.
Declaration
public event EventHandler OnShowed
Event Type
| Type | Description |
|---|---|
| EventHandler |