Repository navigation
fix(android): return ad size for AdLoaderAd banners on Next-Gen SDK - #5
felipefuzaro-funda wants to merge 6 commits into
Conversation
Allow the `AdLoaderAd` instance to serve `Banner` ads, which are instances of: * `AdManagerAdView`/`BannerAd` under Android, and * `GAMBannerView` under iOS
Allow the `AdLoaderAd` instance to serve `Custom` ads, which are instances of: * `NativeCustomFormatAd`/`CustomNativeAd` under Android, and * `GADCustomNativeAd` under iOS
Allow the `AdLoaderAd` instance to serve `Native` ads, which are instances of: * `NativeAd` under Android, and * `GADNativeAd` under iOS
|
Hey @felipefuzaro-funda! A couple of observations:
Putting that together, the second half of the method might be better as: final BannerAd bannerAd = ((AdView) view).getBannerAd();
if (bannerAd == null) {
return null;
}
return new FlutterAdSize(bannerAd.getAdSize()); |
b17c0d9 to
2ed0274
Compare
good points @msbit, thanks! |
|
Ok @felipefuzaro-funda, I've brought in your work, squashing it into the relevant commit and adding you as a co-auther. If you're happy with where |
yes, it looks good to me. A new tag would be great. Thank you @msbit |
|
@felipefuzaro-funda pushed up as |
Summary
Fixes
AdLoaderAd.getAdSize()always returningnullon the Next-Gen Ads SDK (adsNextGenSdk). Banner ads loaded viaAdLoaderAdnow report their size, matching the legacy (playServices) behavior.Problem
In the Next-Gen source set,
FlutterAdLoaderAd#getAdSize()was a stub returningnull, so size was unavailable forAdLoaderAdbanners while legacy worked.Fix
Derive the size from the loaded banner
AdViewviagetBannerAd().getAdSize(), the same call used by Next-GenFlutterBannerAd. Theinstanceof AdViewguard keeps custom/native types returningnull. No new imports needed.