I have an app that should show a bit large ads in some scenarios, of height 250dp, and a height that's the device's height.
In other cases, it's a different width&height.
I want to know how I can use Admob with mediation, so that if I use banner ads, they will fill this space I provide to it, or tell me if it can't.
So, for the case of 250dp in height, I chose to use MEDIUM_RECTANGLE:
https://developers.google.com/android/reference/com/google/android/gms/ads/AdSize#public-static-final-adsize-medium_rectangle> Interactive Advertising Bureau (IAB) medium rectangle ad size (300x250 density-independent pixels).
For other cases, I've checked if their sizes fit enough by looping over them all, and if not, I switch to other kinds of ads.
The reason I do this is because trying to use inline adaptive banners, they got me a small banner when using AdSize.getInlineAdaptiveBannerAdSize , and it made sense because it says "maxHeight" for its second parameter. I just didn't expect it to get me much smaller height sometimes.
https://developers.google.com/admob/android/banner/inline-adaptiveSadly, even using MEDIUM_RECTANGLE, I still sometimes get much smaller banner ads, so I have empty space because of it.
I don't know why this occurs, but maybe it's related to the fact I use mediation too (I couldn't identify the ad network that showed such ads, as there was no icon on any of its corners), and not just Admob, and some ad-sources provide the small banner ads and not large ones, and Admob mediation doesn't handle it properly.
The docs of mediation just say "banner", without telling us which sizes and types of banner ads are supported:
https://developers.google.com/admob/android/choose-networksI also tried to use AdSize.FLUID, but even when using the device as a test device, I've seen that IronSource shows it as a small banner ad instead.
Trying to test other ad-sources didn't work, as they keep failing getting any ad (3 No fill): Applovin, Chartboost, InMobi, Unity.
However, others do seem to give me a proper ad with this size, at least according to the few times I've tried: IronSource, LiftOff, Mintegral.
I don't know though if they are test ads or real ads when adding current device as test device using Admob's API. I had to use ad-inspector after all, to force showing them, but then I don't know what happens to the ads.
It's also impossible to test with ad-inspector to check if one of the ad-networks that don't require an SDK - work fine, as it shows only those that have SDK, and offers to choose only from them. Not to mention it shows some ad-networks multiple times, even though they weren't set to have waterfall, for example.
This issue exists only when using real ad-unit-ids of a real app-id, of course.
Using test ad-unit-ids, it's using very few sizes of ads, and always the good ones...
So, please fix this issue:
1. Update mediation docs about which ad-networks support which banner ad-sizes and banner types, including those that don't require an SDK.
2. For each ad-network, also mention how to use each banner size/type.
3. Don't allow fixed sized banner ads to get us the wrong size, ever, including when using mediation. When an ad network returns you such a thing, fix it by communicating with them and update the docs&SDK accordingly.
4. Please offer an API that will have banner ads more flexible in size. I provide the available space I need, and the SDK will offer me which sizes it can provide for it, giving me the choice if I want to use it or not (but also when I choose one, really use it and return this size of an ad).
For reference, this issue was found on Pixel 6 with Android 15, and these are the dependencies:
```
implementation("com.google.android.gms:play-services-ads:23.6.0")
implementation("com.google.ads.mediation:inmobi:10.8.0.0")
implementation("com.google.ads.mediation:vungle:7.4.3.0")
implementation("com.google.ads.mediation:mintegral:16.8.61.0")
implementation("com.google.ads.mediation:chartboost:9.8.2.0")
implementation("com.google.ads.mediation:applovin:13.1.0.0")
implementation("com.google.ads.mediation:ironsource:8.6.1.0")
implementation("com.unity3d.ads:unity-ads:4.13.1")
implementation("com.google.ads.mediation:unity:4.13.1.0")
```
This was reported here too:
https://github.com/googleads/googleads-mobile-android-mediation/issues/559