Conversation
Add getCreativeWidth()/getCreativeHeight() so consumers can learn which requested size won inside BannerViewListener.onAdLoaded(BannerView). For a multi-size rendering placement (e.g. 300x250 + 320x50) the host otherwise must reserve the bounding box and cannot shrink to the rendered creative. Non-breaking getters sourced from the already-populated bidResponse winning bid (dp; 0 on no-fill). iOS already surfaces this via bannerView(_:didReceiveAdWithAdSize:). Fixes prebid#1006.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1006.
Problem
The rendering
BannerViewgives consumers no way to learn which requested size actually won.BannerViewListener.onAdLoaded(BannerView)carries no size and there's no getter for the rendered creative's dimensions. For a multi-size rendering placement (multiple sizes on oneBannerViewviaaddAdditionalSizes(...), e.g. 300x250 + 320x50) the host must reserve the bounding box of all requested sizes and, when a smaller creative wins, has no signal to shrink the slot — leaving whitespace. iOS already exposes this viabannerView(_:didReceiveAdWithAdSize:).Change
Two non-breaking public getters on
BannerView:getCreativeWidth()→ winning bid width in dp (0 on no-fill)getCreativeHeight()→ winning bid height in dp (0 on no-fill)They delegate to the already-populated
bidResponse.getWinningBid()(the same valuedisplayPrebidView()uses to size the child viagetWinningBidWidthHeightPairDips).onAdLoadedfires afterbidResponseis set, so the value is available at callback time. Getters rather than a new listener method, so no existing implementer breaks.On the ad-server (GAM) win path the served view owns its size, so these reflect the Prebid winning bid — which is exactly the pure-rendering case this targets.
Notes
didReceiveAdWithAdSize.Developed with AI assistance.