Skip to content

Conversation

@Almaju
Copy link
Contributor

@Almaju Almaju commented Nov 13, 2025

  • Adds support for three ad types: Image, Spoc (Sponsored Content), and UA Tile
  • Introduces type-specific request methods:
    • request_image_ads() — returns single image ads per placement
    • request_spoc_ads() — returns multiple spoc ads per placement (with count parameter)
    • request_ua_tile_ads() — returns single UA tile ads per placement
  • Implements an untagged enum (Ad) to deserialize different ad types from JSON responses
  • Adds type filtering logic to extract and validate specific ad types from API responses
  • Ensures correct deserialization by ordering enum variants (Spoc/UATile before Image) to prevent misclassification
  • Adds error handling for unexpected ad types when the API returns a different type than requested
  • Updates FFI layer with corresponding MozAdsImage, MozAdsSpoc, and MozAdsUATile structs for the public API

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

@Almaju Almaju force-pushed the ads-client-ad-types branch 2 times, most recently from a7aaf52 to 9b787b4 Compare November 14, 2025 18:29
@Almaju Almaju marked this pull request as ready for review November 14, 2025 18:29
@Almaju Almaju force-pushed the ads-client-ad-types branch 3 times, most recently from 6e29755 to 05bbf78 Compare November 14, 2025 19:33
@luc-lisi luc-lisi self-assigned this Nov 14, 2025
@Almaju Almaju force-pushed the ads-client-ad-types branch 2 times, most recently from d1ad0ae to 4ff3808 Compare November 14, 2025 22:59
@Almaju Almaju force-pushed the ads-client-ad-types branch 3 times, most recently from 058bb97 to 74049d0 Compare November 17, 2025 17:59
@Almaju Almaju force-pushed the ads-client-ad-types branch from 74049d0 to 669d6d8 Compare November 17, 2025 17:59
Copy link
Contributor

@luc-lisi luc-lisi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! Thanks so much for this 🎉

You mentioned it in that other PR but I'd just make sure to rename these from ...UATile -> Tile to fit the new schema, but otherwise should be good to go 🚢

Copy link
Contributor

@luc-lisi luc-lisi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh actually, I realize we need to update the docs to include these new endpoints. I think we still have request_ads and are missing the one for tiles. But just a minor change and then it should be good to go!

@Almaju Almaju enabled auto-merge November 17, 2025 22:59
@Almaju Almaju added this pull request to the merge queue Nov 17, 2025
Merged via the queue into mozilla:main with commit 833cc3d Nov 17, 2025
13 checks passed
@Almaju Almaju deleted the ads-client-ad-types branch November 17, 2025 23:45
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.

2 participants