Search Results for

Show / Hide Table of Contents

# Class InterstitialAd

A full page ad experience at natural transition points, such as a page change or an app launch. Interstitials use a close button that removes the ad from the user's experience.

##### Inheritance

object
InterstitialAd

##### Implements

IInterstitialAd
IDisposable
IAdUnit
IMultiformattedAd
IResizableAd
ISkippableAd
IMuteableAd
ICloseableAd
IModalAd
ILoadableAd
IAdEventSource
IModalAdEventSource

##### Inherited Members

object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()

###### Namespace: AppstockSDK.Api

###### Assembly: Appstock.Api.dll

##### Syntax

    public class InterstitialAd : IInterstitialAd, IDisposable, IAdUnit, IMultiformattedAd, IResizableAd, ISkippableAd, IMuteableAd, ICloseableAd, IModalAd, ILoadableAd, IAdEventSource, IModalAdEventSource

### Constructors

#### InterstitialAd()

Initializes a new instance of the InterstitialAd class.

##### Declaration

    public InterstitialAd()

### Properties

#### AdSizes

Sets ad sizes for the ad.

##### Declaration

    public IEnumerable<AdSize> AdSizes { set; }

##### Property Value

Type | Description
--- | ---
IEnumerable<AdSize> | Sizes that ad's content may take.

#### AdUnitFormats

Sets formats for the ad unit.

##### Declaration

    public IEnumerable<AdFormat> AdUnitFormats { set; }

##### Property Value

Type | Description
--- | ---
IEnumerable<AdFormat> | Ad formats that are allowed into the ad.

#### CloseButtonArea

Sets close button area factor.

##### Declaration

    public double CloseButtonArea { set; }

##### Property Value

Type | Description
--- | ---
double | the percentage of the device screen that the close button should cover.

##### Remarks

Allowed range - `0...1`.

Default value is ~`0.1`.

#### CloseButtonPosition

Sets position of the close button.

##### Declaration

    public AdElementPosition CloseButtonPosition { set; }

##### Property Value

Type | Description
--- | ---
AdElementPosition | Where the close button appears on the screen.

##### Remarks

Allowed values: TopLeft, TopRight.

Default is TopRight.

#### EndpointID

Sets the endpoint ID for the ad.

##### Declaration

    public string? EndpointID { set; }

##### Property Value

Type | Description
--- | ---
string | Unique endpoint identifier generated on the Appstock platform’s UI.

#### Loaded

Gets if ad has loaded.

##### Declaration

    public bool Loaded { get; }

##### Property Value

Type | Description
--- | ---
bool | `true` if ad has successfully loaded, `false` otherwise.

#### Muted

Sets if ad is to be muted.

##### Declaration

    public bool Muted { set; }

##### Property Value

Type | Description
--- | ---
bool | `true` if muted, `false` otherwise.

#### PlacementID

Sets the placement ID for the ad.

##### Declaration

    public string? PlacementID { set; }

##### Property Value

Type | Description
--- | ---
string | Unique placement identifier generated on the Appstock platform’s UI.

#### SkipButtonArea

Sets skip button area factor.

##### Declaration

    public double SkipButtonArea { set; }

##### Property Value

Type | Description
--- | ---
double | the percentage of the device screen that the skip button should cover.

##### Remarks

Allowed range - `0...1`.

Default value is ~`0.1`.

#### SkipButtonPosition

Sets position of the skip button.

##### Declaration

    public AdElementPosition SkipButtonPosition { set; }

##### Property Value

Type | Description
--- | ---
AdElementPosition | Where the skip button appears on the screen.

##### Remarks

Allowed values: TopLeft, TopRight.

Default is TopRight.

#### SkipDelay

Sets skip button appearing delay for the ad.

##### Declaration

    public int SkipDelay { set; }

##### Property Value

Type | Description
--- | ---
int | Number of seconds after the start of playback before the skip or close button should appear.

##### Remarks

Default value is ~`10.0`.

#### SoundButtonVisible

Sets if `Mute` button is visible when the ad is on display.

##### Declaration

    public bool SoundButtonVisible { set; }

##### Property Value

Type | Description
--- | ---
bool | `true` if visible, `false` otherwise.

### Methods

#### Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

##### Declaration

    public void Dispose()

#### Dispose(bool)

Releases the unmanaged resources used by the class and optionally releases the managed resources.

##### Declaration

    protected virtual void Dispose(bool disposing)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | disposing | `true` to release both managed and unmanaged resources; `false` to release only unmanaged resources.

#### ~InterstitialAd()

##### Declaration

    protected ~InterstitialAd()

#### LoadAd()

Load the content of the ad.

##### Declaration

    public void LoadAd()

#### Show(Action?)

Show the ad on screen.

##### Declaration

    public void Show(Action? actionOnUIThread = null)

##### Parameters

Type | Name | Description
--- | --- | ---
Action | actionOnUIThread | Something you want to execute immediately when the ad is being added to the screen `actionOnUIThread` is invoked on NATIVE UI THREAD which MAY DIFFER from UNITY'S MAIN THREAD.

### Events

#### OnAdClicked

Fired when ad was clicked on.

##### Declaration

    public event Action? OnAdClicked

##### Event Type

Type | Description
--- | ---
Action |

#### OnAdClosed

Fired when ad was closed (from fullscreen mode).

##### Declaration

    public event Action? OnAdClosed

##### Event Type

Type | Description
--- | ---
Action |

#### OnAdDisplayed

Fired when ad did appear on screen.

##### Declaration

    public event Action? OnAdDisplayed

##### Event Type

Type | Description
--- | ---
Action |

#### OnAdFailed

Fired when ad failed to load.

##### Declaration

    public event Action<AdError?>? OnAdFailed

##### Event Type

Type | Description
--- | ---
Action<AdError?> |

#### OnAdLoaded

Fired when ad finished loading.

##### Declaration

    public event Action<AdInfo?>? OnAdLoaded

##### Event Type

Type | Description
--- | ---
Action<AdInfo?> |

### Implements

IInterstitialAd
IDisposable
IAdUnit
IMultiformattedAd
IResizableAd
ISkippableAd
IMuteableAd
ICloseableAd
IModalAd
ILoadableAd
IAdEventSource
IModalAdEventSource