Skip to content

fix: AdLoaderAd dropping custom targeting on next-gen Android SDK - #4

Merged
msbit merged 2 commits into
msbit:v9.0.0-ad-loader-adfrom
felipefuzaro-funda:fix/v9.0.0-ad-loader-ad
Sep 9, 2026
Merged

msbit merged 2 commits into
msbit:v9.0.0-ad-loader-adfrom
felipefuzaro-funda:fix/v9.0.0-ad-loader-ad

Conversation

@felipefuzaro-funda

@felipefuzaro-funda felipefuzaro-funda commented Sep 1, 2026 •

Copy link
Copy Markdown

Problem

On the next-gen Android SDK (USE_NEXT_GEN_SDK=true, ads-mobile-sdk:1.1.1),
AdLoaderAd requests were built without applying the ad request, so custom
targeting, keywords, content URL, neighboring URLs, request agent, and PPID were
dropped. Targeted line items didn't match → No fill. Legacy play-services
and iOS were unaffected.

Fix

  • FlutterAdRequest (next-gen): add configureNativeAdRequestBuilder(...) to
    apply common request fields to NativeAdRequest.Builder.
  • FlutterAdManagerAdRequest (next-gen): override to also apply custom
    targeting, targeting lists, and PPID.
  • FlutterAdLoader (next-gen): thread the request into
    loadAdLoaderAd/loadAdManagerAdLoaderAd and apply it before load.
  • FlutterAdLoaderAd (next-gen): pass the request through in load().

Notes

  • iOS already applies targeting via asGAMRequest:; no change needed.
  • Network/mediation extras intentionally omitted from the AdLoader path.
  • Cherry-picks 9689087

@felipefuzaro-funda felipefuzaro-funda changed the title fix: AdLoaderAd dropping custom targeting on next-gen Android fix: AdLoaderAd dropping custom targeting on next-gen Android SDK Sep 1, 2026
@msbit

msbit commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Hey @felipefuzaro-funda. It looks like the LoadAdError is handled a bit differently (in the Android layer) as part of 9689087. If you can confirm that this does in fact fix that problem, it would be cleaner to remove the change relating to that error (eb1a9f7 and a bit of cba3f82), and then cherry-pick that commit. Or contemplate rebasing this onto v9.1.0.

@felipefuzaro-funda

Copy link
Copy Markdown
Author

Hey @felipefuzaro-funda. It looks like the LoadAdError is handled a bit differently (in the Android layer) as part of 9689087. If you can confirm that this does in fact fix that problem, it would be cleaner to remove the change relating to that error (eb1a9f7 and a bit of cba3f82), and then cherry-pick that commit. Or contemplate rebasing this onto v9.1.0.

Good point @msbit. I've rolled it back and cherry-picked the fix. I see that some workflows failed due to formatting and the contribution guide says to run dart pub global run flutter_plugin_tools format, but that applies changes to a bunch of untouched files in the samples projects. Let me know if it is needed anyway.

@msbit

msbit commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Looks good @felipefuzaro-funda. Could you squash d766609 into cba3f82 (it's basically a fixup)?

I see that some workflows failed due to formatting and the contribution guide says to run dart pub global run flutter_plugin_tools format, but that applies changes to a bunch of untouched files in the samples projects.

At some point that command was removed from the github workflows, so the code overall has drifted quite a bit from what the contributing guide would have you believe. It's not our problem, basically. If you wanted, you could consider running that format command then incorporating the formatting fixes related to your code, but that can be painful for files that you've just changed a few things in.

@felipefuzaro-funda

Copy link
Copy Markdown
Author

Looks good @felipefuzaro-funda. Could you squash d766609 into cba3f82 (it's basically a fixup)?

I see that some workflows failed due to formatting and the contribution guide says to run dart pub global run flutter_plugin_tools format, but that applies changes to a bunch of untouched files in the samples projects.

At some point that command was removed from the github workflows, so the code overall has drifted quite a bit from what the contributing guide would have you believe. It's not our problem, basically. If you wanted, you could consider running that format command then incorporating the formatting fixes related to your code, but that can be painful for files that you've just changed a few things in.

done. For me it's okay to proceed without the formatting

@msbit
msbit merged commit 330fa5a into msbit:v9.0.0-ad-loader-ad Sep 9, 2026
@msbit

msbit commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Okay @felipefuzaro-funda, I've merged that in. I've also made another tag v9.0.0-ad-loader-ad-2 which you can use if you like. The merge was a rebase merge to ensure there wasn't a new merge commit made, but that seems to have created two new commits and added them on; the Author: remains intact though.

@felipefuzaro-funda

Copy link
Copy Markdown
Author

Okay @felipefuzaro-funda, I've merged that in. I've also made another tag v9.0.0-ad-loader-ad-2 which you can use if you like. The merge was a rebase merge to ensure there wasn't a new merge commit made, but that seems to have created two new commits and added them on; the Author: remains intact though.

thanks @msbit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants