GoogleMobileAds.Api.BannerView

Banner views occupy a spot within an app's layout.

Summary

They stay on screen while users are interacting with the app.

Inheritance

Direct Known Subclasses:GoogleMobileAds.Api.AdManager.AdManagerBannerView

Constructors and Destructors

BannerView(string adUnitId, AdSize adSize, AdPosition position)
Creates a banner view with a standard position.
BannerView(string adUnitId, AdSize adSize, int x, int y)
Creates a banner view with a custom position.

Events

OnAdClicked
Action
Raised when an ad is clicked.
OnAdFullScreenContentClosed
Action
Raised when the ad closed full-screen content.
OnAdFullScreenContentOpened
Action
Raised when an ad opened full-screen content.
OnAdImpressionRecorded
Action
Raised when an impression is recorded for an ad.
OnAdPaid
Action< AdValue >
Raised when the ad is estimated to have earned money.
OnBannerAdLoadFailed
Action< LoadAdError >
Raised when an ad fails to load into the banner view.
OnBannerAdLoaded
Action
Raised when an ad is loaded into the banner view.

Properties

IsDestroyed
bool
Returns true if Destroy() has been called.

Public functions

Destroy()
void
Destroys the banner view.
GetHeightInPixels()
float
Returns the height of the banner view in pixels.
GetResponseInfo()
Returns the ad request response info or null if the ad is not loaded.
GetWidthInPixels()
float
Returns the width of the banner view in pixels.
Hide()
void
Hides the banner view.
LoadAd(AdRequest request)
void
Loads an ad into the banner view.
SetPosition(AdPosition adPosition)
void
Sets the position of the banner view using standard position.
SetPosition(int x, int y)
void
Sets the position of the banner view using custom position.
Show()
void
Shows the banner view.

Events

OnAdClicked

Action OnAdClicked

Raised when an ad is clicked.

OnAdFullScreenContentClosed

Action OnAdFullScreenContentClosed

Raised when the ad closed full-screen content.

On iOS, this event is only raised when an ad opens an overlay, not when opening a new application such as Safari or the App Store.

OnAdFullScreenContentOpened

Action OnAdFullScreenContentOpened

Raised when an ad opened full-screen content.

OnAdImpressionRecorded

Action OnAdImpressionRecorded

Raised when an impression is recorded for an ad.

OnAdPaid

Action< AdValue > OnAdPaid

Raised when the ad is estimated to have earned money.

OnBannerAdLoadFailed

Action< LoadAdError > OnBannerAdLoadFailed

Raised when an ad fails to load into the banner view.

OnBannerAdLoaded

Action OnBannerAdLoaded

Raised when an ad is loaded into the banner view.

Properties

IsDestroyed

bool IsDestroyed

Returns true if Destroy() has been called.

Public functions

BannerView

 BannerView(
  string adUnitId,
  AdSize adSize,
  AdPosition position
)

Creates a banner view with a standard position.

BannerView

 BannerView(
  string adUnitId,
  AdSize adSize,
  int x,
  int y
)

Creates a banner view with a custom position.

Destroy

void Destroy()

Destroys the banner view.

GetHeightInPixels

float GetHeightInPixels()

Returns the height of the banner view in pixels.

GetResponseInfo

ResponseInfo GetResponseInfo()

Returns the ad request response info or null if the ad is not loaded.

GetWidthInPixels

float GetWidthInPixels()

Returns the width of the banner view in pixels.

Hide

void Hide()

Hides the banner view.

LoadAd

void LoadAd(
  AdRequest request
)

Loads an ad into the banner view.

SetPosition

void SetPosition(
  AdPosition adPosition
)

Sets the position of the banner view using standard position.

SetPosition

void SetPosition(
  int x,
  int y
)

Sets the position of the banner view using custom position.

Show

void Show()

Shows the banner view.