Stay organized with collections
Save and categorize content based on your preferences.
GoogleMobileAds.Api.AdManager.AdManagerBannerView
Banner view that works with Google Ad Manager.
Summary
Banner views occupy a spot within an app's layout. They stay on screen while users are interacting with the app.
Inheritance
Inherits from:
GoogleMobileAds.Api.BannerView
Properties
|
ValidAdSizes
|
Sets the supported sizes of the banner ad.
|
Events
OnAppEventReceived
Action< AppEvent > OnAppEventReceived
Raised when the app receives an event from the banner ad.
Properties
ValidAdSizes
List< AdSize > ValidAdSizes
Sets the supported sizes of the banner ad.
In most cases, only one ad size will be specified. Use one of the predefined standard ad sizes (such as AdSize.MediumRectangle), or create one by specifying width and height.
Multiple ad sizes can be specified if your application can appropriately handle multiple ad sizes. For example, your application might read ValidAdSizes during the AdManagerBannerView::OnBannerAdLoaded callback and change the layout according to the size of the ad that was loaded. If multiple ad sizes are specified, the AdManagerBannerView will assume the size of the first ad size until an ad is loaded.
This method also immediately resizes the currently displayed ad, so calling this method after an ad has been loaded is not recommended unless you know for certain that the content of the ad will render correctly in the new ad size. This can be used if an ad needs to be resized after it has been loaded. If more than one ad size is specified, the currently displayed ad will be resized to the first ad size.
Public functions
AdManagerBannerView
AdManagerBannerView(
string adUnitId,
AdSize adSize,
AdPosition position
)
Creates an Ad Manager banner view with a standard position.
AdManagerBannerView
AdManagerBannerView(
string adUnitId,
AdSize adSize,
int x,
int y
)
Creates an Ad Manager banner view with a custom position.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-09-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-09-07 UTC."],[[["`AdManagerBannerView` is a banner view for Unity apps that works with Google Ad Manager, displaying ads within the app's layout while users interact with it."],["It inherits properties from the `BannerView` class and allows for the setting of supported ad sizes with the `ValidAdSizes` property."],["Developers can specify ad positions using either standard positions like `AdPosition.Top` or custom positions with x and y coordinates."],["It exposes an event called `OnAppEventReceived` which is triggered when the app receives an event, such as impressions or clicks, from the displayed banner ad."],["Although it supports specifying multiple ad sizes, it's recommended to use a single, predefined standard size or create one by explicitly defining width and height for optimal performance and layout management."]]],[]]