Interface IBannerAd
Defines the contract for a UI container that manages and displays banner advertisements.
Namespace: Chartboost.Mediation.Ad.Banner
Assembly: Chartboost.Mediation.dll
Syntax
public interface IBannerAd : IAd, IDisposable
Properties
BannerSize
Gets the size of the banner ad loaded inside this container. Note that this will change with auto-refresh and will be notified in WillAppear
Declaration
BannerSize? BannerSize { get; }
Property Value
| Type | Description |
|---|---|
| BannerSize? |
ContainerSize
Gets or sets the size of the container.
Declaration
ContainerSize ContainerSize { get; set; }
Property Value
| Type | Description |
|---|---|
| ContainerSize |
Draggable
Gets or sets a value indicating whether this container can be dragged on the screen.
Declaration
bool Draggable { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
HorizontalAlignment
The horizontal alignment of the ad within its container.
Declaration
BannerHorizontalAlignment HorizontalAlignment { get; set; }
Property Value
| Type | Description |
|---|---|
| BannerHorizontalAlignment |
Keywords
The keywords targeted for the ad.
Declaration
IReadOnlyDictionary<string, string> Keywords { get; set; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, string> |
LoadId
The identifier for this load call. Note that this will change with auto-refresh and will be notified in WillAppear
Declaration
string LoadId { get; }
Property Value
| Type | Description |
|---|---|
| string |
LoadMetrics
The load metrics for the most recent successful load operation, or Null if a banner is not loaded. If auto-refresh is enabled, this value will change over time. The WillAppear event will be called after this value changes.
Declaration
Metrics? LoadMetrics { get; }
Property Value
| Type | Description |
|---|---|
| Metrics? |
PartnerSettings
Optional partner-specific settings that can be associated with the advertisement placement.
Declaration
IReadOnlyDictionary<string, string> PartnerSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, string> |
Pivot
Gets or sets the Pivot property, which defines the normalized pivot point of this container within the screen coordinate system from which all transformations and layout computations, such as width and height, are based. This property functions similarly to the pivot in Unity's RectTransform
- X-Axis: Horizontal position within the container, normalized to the container's width. A value of 0 aligns the pivot with the left edge, while a value of 1 aligns with the right edge.
- Y-Axis: Vertical position within the container, normalized to the container's height. A value of 0 aligns the pivot with the top edge, while a value of 1 aligns with the bottom edge. Examples:
- (0, 0): Pivot at the top-left corner of the container.
- (0.5, 0.5): Pivot at the center of the container.
- (1, 1): Pivot at the bottom-right corner of the container.
Declaration
Vector2 Pivot { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
Position
The position of the Pivot of this container on the screen in the Screen Coordinate System. X-Axis: The horizontal axis, with positive values increasing to the right. Y-Axis: The vertical axis, with positive values increasing downward.
Declaration
Vector2 Position { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
Request
The publisher supplied request that was used to load the ad.
Declaration
BannerAdLoadRequest Request { get; }
Property Value
| Type | Description |
|---|---|
| BannerAdLoadRequest |
VerticalAlignment
The vertical alignment of the ad within its container.
Declaration
BannerVerticalAlignment VerticalAlignment { get; set; }
Property Value
| Type | Description |
|---|---|
| BannerVerticalAlignment |
Visible
Gets or sets a value indicating the visibility of the container.
Declaration
bool Visible { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
WinningBidInfo
The winning bid info for the ad. Note that this will change with auto-refresh and will be notified in WillAppear
Declaration
BidInfo? WinningBidInfo { get; }
Property Value
| Type | Description |
|---|---|
| BidInfo? |
Methods
Dispose()
Disposes the ad along with its container. This should be called when the ad is no longer needed.
Declaration
void Dispose()
Load(BannerAdLoadRequest)
Loads an ad.
Declaration
Task<BannerAdLoadResult> Load(BannerAdLoadRequest request)
Parameters
| Type | Name | Description |
|---|---|---|
| BannerAdLoadRequest | request | The ChartboostMediationBannerAdLoadRequest request |
Returns
| Type | Description |
|---|---|
| Task<BannerAdLoadResult> |
Reset()
Clears the loaded ad
Declaration
void Reset()
Events
DidBeginDrag
Called when the ad container has begun dragging on screen.
Declaration
event BannerAdDragEvent DidBeginDrag
Event Type
| Type | Description |
|---|---|
| BannerAdDragEvent |
DidClick
Called when the ad executes its click-through. This may happen multiple times for the same ad.
Declaration
event BannerAdEvent DidClick
Event Type
| Type | Description |
|---|---|
| BannerAdEvent |
DidDrag
Called when the ad container is dragged on screen.
Declaration
event BannerAdDragEvent DidDrag
Event Type
| Type | Description |
|---|---|
| BannerAdDragEvent |
DidEndDrag
Called when the ad container has finished dragging on screen.
Declaration
event BannerAdDragEvent DidEndDrag
Event Type
| Type | Description |
|---|---|
| BannerAdDragEvent |
DidRecordImpression
Called when the ad impression occurs.
Declaration
event BannerAdEvent DidRecordImpression
Event Type
| Type | Description |
|---|---|
| BannerAdEvent |
WillAppear
Called when ad is loaded within its container. This will be called for each refresh when auto-refresh is enabled.
Declaration
event BannerAdEvent WillAppear
Event Type
| Type | Description |
|---|---|
| BannerAdEvent |