You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: com.chartboost.mediation/Documentation/integration/loading-ads.md
+73-4Lines changed: 73 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,15 +57,47 @@ Debug.Log($"Fullscreen Placement Loaded with PlacementName: {placementName}")
57
57
> **Warning**\
58
58
> The new fullscreen API utilizes instance based callbacks to notify information regarding the advertisement life-cycle. You must take this into account when migrating from the old API static callbacks.
59
59
60
-
## Creating Banner Ad Objects
60
+
## Banner Ad Objects
61
+
62
+
Mediation SDK 4.6.0 introduces a new [Adaptive Banner](https://docs.chartboost.com/en/mediation/ad-types/#adaptive-banner/) ad format, capable of serving flexible and fixed sized ads in the placement. The new [Adaptive Banner]([/en/mediation/ad-types/#adaptive-banner/](https://docs.chartboost.com/en/mediation/ad-types/#adaptive-banner/)) ad format has the following features:
63
+
- Publishers can choose whether to use Adaptive Ads or Fixed Ads in a given placement.
64
+
- Fixed Ads are supported in Adaptive Ad placements (backwards compatible).
65
+
- Publishers should know whether an ad is fixed or flexible and receive the dimensions of fixed ads.
66
+
- Publishers can align the ad horizontally and/or vertically.
67
+
- Publishers can resize the ad container to fit the ad or optionally discard oversized ads that are rendered in the container.
68
+
- The ad container can be in-line or on top of publisher content.
69
+
70
+
To use this new ad format, Publishers will need to create a new Adaptive Banner placement in their platform and integrate with the new Adaptive Banner APIs.
71
+
72
+
> **Caution**\
73
+
> Google Bidding does not support 0 height adaptive banner sizes and will result in no fill.
74
+
75
+
76
+
We have added a new Banner API `ChartboostMedaitionBannerView` to allow usage of adaptive banners. The previous `ChartboostMedaitionBannerAd` API has now been deprecated.
61
77
62
-
Since Chartboost Mediation Unity SDK 4.6.X we have deprecated the previous approach for loading banner placements. A new Banner API `ChartboostMedaitionBannerView` has been provided which makes use of C# asycn/await methods in order to await for load and show and also provides support to load adaptive size banners.
63
78
64
79
Another API `ChartboostMediationUnityBannerAd` is also provided which allows usage of unity gameobjects to load a banner ad within it.
65
80
81
+
The API class `ChartboostMediationBannerSize` will support both fixed and adaptive banners:
82
+
83
+
|Field|Description|
84
+
|--|--|
85
+
|`static ChartboostMediationBannerSize Standard`|Static constant that returns a fixed `STANDARD` banner with a size of 320x50.|
86
+
|`static ChartboostMediationBannerSize MediumRect`|Static constant that returns a fixed MREC `MEDIUM` banner with a size of 300x250.|
87
+
|`static ChartboostMediationBannerSize Leaderboard`|Static constant that returns a fixed `LEADERBOARD` banner with a size of 728x90.|
88
+
|`ChartboostMediationBannerType BannerType`|An enum specifying that the ad size is fixed (size cannot change), or adaptive (size can change but must maintain aspectRatio). This is an integer based enum.|
89
+
|`float Width`|The width of the ad.|
90
+
|`float Height`|The height of the ad.|
91
+
|`float AspectRatio`|The aspect ratio of the ad. This can be derived from the size. Will be 0 if either the width or the height are <= 0.|
92
+
|`static ChartboostMediationBannerSize Adaptive(float width)`|Creates a flexible/adaptive banner size with 0 height.|
93
+
|`static ChartboostMediationBannerSize Adaptive(float width, float height)`|Creates a flexible/adaptive banner size with a width and max height. Used either when the height of an inline ad should be capped, or when requesting an anchored banner.|
94
+
|`<additional conveniences>`|This provides additional conveniences to create sizes based on the IAB ratios (e.g. 6:1, 1:1) with a width. For example, using the 6:1 convenience with a 600 width would return a size of 600x100. Note that these are max sizes, therefore smaller sizes or other aspect ratios may be served.|
95
+
96
+
97
+
### Loading Banner ads
66
98
A detailed example on the load logic for both of these APIs can be found below :
67
99
68
-
### Using `ChartboostMediationBannerView` API
100
+
####Using `ChartboostMediationBannerView` API
69
101
70
102
```c#
71
103
// Get a bannerView
@@ -111,7 +143,7 @@ float y = ChartboostMediationConverters.PixelsToNative(200);
111
143
awaitbannerView.Load(loadRequest, x, y);
112
144
```
113
145
114
-
### Using `ChartboostMediationUnityBannerAd` API
146
+
####Using `ChartboostMediationUnityBannerAd` API
115
147
116
148
`ChartboostMediationUnityBannerAd` API enables loading of a bannerAd within a unity gameobject.
117
149
To create this gameobject, right-click in the hierarchy window and select `Chartboost Mediation/UnityBannerAd`
You can implement delegates in your class to receive notifications about the success or failure of the ad loading process for Banner formats. See section [Delegate Usage](delegate-usage.md) for more details.
150
182
183
+
### Resizing Adaptive Banner Container
184
+
185
+
#### Using `ChartboostMediationBannerView` API
186
+
187
+
```C#
188
+
bannerView.DidLoad+= (banner) =>
189
+
{
190
+
// Determine the axis on which you want the bannerView to resize
0 commit comments