Companion ads don't show when targeting API 29
See original GitHub issue[REQUIRED] Use case description
Provide and example with Companion Ad integration.
Current code have
/**
* Sets the slots for displaying companion ads. Individual slots can be created using {@link
* ImaSdkFactory#createCompanionAdSlot()}.
*
* @param companionSlots Slots for displaying companion ads.
* @see AdDisplayContainer#setCompanionSlots(Collection)
* @deprecated Use {@code getAdDisplayContainer().setCompanionSlots(...)}.
*/
@Deprecated
public void setCompanionSlots(Collection<CompanionAdSlot> companionSlots) {
adDisplayContainer.setCompanionSlots(companionSlots);
}
But there is no implementation example. Having Companion Ad integration would help us debug and troubleshoot any issues when it doesn’t work on our clients.
Proposed solution
Currently we have in our client code this part
CompanionAdView companionAdView = companionProvider.getCompanionAdView();
// Set up spots for companions.
CompanionAdSlot companionAdSlot = imaFactory.createCompanionAdSlot();
companionAdSlot.setContainer(companionAdView.getCompanionViewGroup());
companionAdSlot.setSize(companionAdView.getWidth(), companionAdView.getHeight());
ArrayList<CompanionAdSlot> companionAdSlots = new ArrayList<>();
companionAdSlots.add(companionAdSlot);
adDisplayContainer.setCompanionSlots(companionAdSlots);
Recent update to targetSdk
29 made it impossible to display companion banner( it’s shown as blank white). So we were hoping to compare with ExoPlayer IMA integration and check if it’s something on our side.
Alternatives considered
I can’t think of any alternative solutions.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
Meet Google Play's target API level requirement
When you upload an APK, it must meet Google Play's target API level requirements. New apps must target Android 12 (API level 31)...
Read more >Companion ads | IMA SDK for Android - Google Developers
This guide is intended for publishers interested in adding companion ads ... See the BasicExample if you don't already have an app with...
Read more >Admob banner doesn't show up with target sdk 30
I can't lower the target sdk to 29 because it's the new requirement from google play(Target API level 30 (Android 11) or above)...
Read more >August 2014 - Google Ads Developer Blog
Starting the week of September 29, 2014, we're changing the way we report mobile click-to-call data in AdWords API reports.
Read more >Release notes for the Amazon Ads API
Impression forecasting is available for Sponsored Display campaigns with contextual targeting and Amazon audiences. Forecasting helps advertisers understand the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For now I’d like to repurpose this issue to track the problem that companion ads don’t show when updating to target API 29.
I’m not sure it’s worth supporting companion ads in the main ExoPlayer demo app given that the API is pretty simple. Also, in the medium/longer term it’s quite likely that at least one of the IMA SDK sample apps will start using the ExoPlayer IMA extension (TBC though).
I think the IMA SDK release notes item “Adds scaling for Companion Ads on high-pixel-density devices.” may address this and is included in IMA SDK version 3.18.1. The
dev-v2
branch has picked that up (but see also the latest reply on #6429 for a caveat). If this is still reproducible ondev-v2
please let me know and I’ll reopen the issue.