Class Advertisement.Banner
A static class for implementing banner ads.
Namespace: UnityEngine.Advertisements
Syntax
public static class Banner
Properties
isLoaded
Returns true if a banner is currently available, and false if it isn't.
Declaration
public static bool isLoaded { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Methods
Hide(Boolean)
Allows you to hide a banner ad, instead of destroying it altogether.
Declaration
public static void Hide(bool destroy = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | destroy |
Load()
Loads the banner ad with the default Placement, and no callbacks.
Declaration
public static void Load()
Load(String)
Loads the banner ad with a specified Placement, and no callbacks.
Declaration
public static void Load(string placementId)
Parameters
| Type | Name | Description |
|---|---|---|
| String | placementId | The unique identifier for a specific Placement, found on the developer dashboard. |
Load(String, BannerLoadOptions)
Loads the banner ad with a specified Placement, but fires the loadCallback callback on successful load, and the errorCallback callback on failure to load.
Declaration
public static void Load(string placementId, BannerLoadOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| String | placementId | The unique identifier for a specific Placement, found on the developer dashboard. |
| BannerLoadOptions | options | A collection of options that notify the SDK of events when loading the banner. |
Load(BannerLoadOptions)
Loads the banner ad with the default Placement, but fires the loadCallback callback on successful load, and the errorCallback callback on failure to load.
Declaration
public static void Load(BannerLoadOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| BannerLoadOptions | options | A collection of options that notify the SDK of events when loading the banner. |
SetPosition(BannerPosition)
Sets the position of the banner ad, using the BannerPosition enum.
Banner position defaults to BannerPosition.BOTTOM_CENTER.
Declaration
public static void SetPosition(BannerPosition position)
Parameters
| Type | Name | Description |
|---|---|---|
| BannerPosition | position | An enum representing the on-screen anchor position of the banner ad. |
Show()
Displays the banner ad with the default Placement, and no callbacks.
Declaration
public static void Show()
Show(String)
Displays the banner ad with a specified Placement, and no callbacks.
Declaration
public static void Show(string placementId)
Parameters
| Type | Name | Description |
|---|---|---|
| String | placementId | The unique identifier for a specific Placement, found on the developer dashboard. |
Show(String, BannerOptions)
Displays the banner ad with a specified Placement, but fires the showCallback callback if the banner is visible, and the hideCallback if it isn't.
Declaration
public static void Show(string placementId, BannerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| String | placementId | The unique identifier for a specific Placement, found on the developer dashboard. |
| BannerOptions | options | A collection of options that notify the SDK of events when displaying the banner. |
Show(BannerOptions)
Displays the banner ad with the default Placement, but fires the showCallback callback if the banner is visible, and the hideCallback if it isn't.
Declaration
public static void Show(BannerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| BannerOptions | options | A collection of options that notify the SDK of events when displaying the banner. |