Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FXIOS-10715 [sponsored tiles] Get unified ads data with a POST request #23455

Merged
merged 4 commits into from
Nov 28, 2024

Conversation

lmarceau
Copy link
Contributor

📜 Tickets

Jira ticket
Github issue

💡 Description

  • Made changes to UnifiedAdsProvider to build a request either on the prod or staging endpoint. I kept the same caching mechanism as with ContileProvider, so tiles will be cached for an hour.
  • Removed UnifiedAdsNetwork since turns out I can use ContileNetworking to make the url session request.
  • Note; this code is meant to be short lived. This API will be moved to A-S next year, so aiming to do a quick solution using a similar approach to what currently exist in the application.

📝 Checklist

You have to check all boxes before merging

  • Filled in the above information (tickets numbers and description of your work)
  • Updated the PR name to follow our PR naming guidelines
  • Wrote unit tests and/or ensured the tests suite is passing
  • When working on UI, I checked and implemented accessibility (minimum Dynamic Text and VoiceOver)
  • If needed, I updated documentation / comments for complex code and public methods
  • If needed, added a backport comment (example @Mergifyio backport release/v120)

@lmarceau lmarceau requested a review from a team as a code owner November 28, 2024 19:00
@lmarceau lmarceau requested review from mdotb-moz and adudenamedruby and removed request for mdotb-moz November 28, 2024 19:00
Comment on lines 754 to 763
8A3345612BA499B7008C52AB /* disconnect-block-fingerprinting.json in Resources */ = {isa = PBXBuildFile; fileRef = 8A3345572BA499B6008C52AB /* disconnect-block-fingerprinting.json */; };
8A3345622BA499B7008C52AB /* disconnect-block-advertising.json in Resources */ = {isa = PBXBuildFile; fileRef = 8A3345582BA499B6008C52AB /* disconnect-block-advertising.json */; };
8A3345632BA499B7008C52AB /* disconnect-block-cookies-content.json in Resources */ = {isa = PBXBuildFile; fileRef = 8A3345592BA499B6008C52AB /* disconnect-block-cookies-content.json */; };
8A3345642BA499B7008C52AB /* disconnect-block-analytics.json in Resources */ = {isa = PBXBuildFile; fileRef = 8A33455A2BA499B6008C52AB /* disconnect-block-analytics.json */; };
8A3345652BA499B7008C52AB /* disconnect-block-cookies-advertising.json in Resources */ = {isa = PBXBuildFile; fileRef = 8A33455B2BA499B7008C52AB /* disconnect-block-cookies-advertising.json */; };
8A3345662BA499B7008C52AB /* disconnect-block-content.json in Resources */ = {isa = PBXBuildFile; fileRef = 8A33455C2BA499B7008C52AB /* disconnect-block-content.json */; };
8A3345672BA499B7008C52AB /* disconnect-block-cookies-analytics.json in Resources */ = {isa = PBXBuildFile; fileRef = 8A33455D2BA499B7008C52AB /* disconnect-block-cookies-analytics.json */; };
8A3345682BA499B7008C52AB /* disconnect-block-social.json in Resources */ = {isa = PBXBuildFile; fileRef = 8A33455E2BA499B7008C52AB /* disconnect-block-social.json */; };
8A3345692BA499B7008C52AB /* disconnect-block-cookies-social.json in Resources */ = {isa = PBXBuildFile; fileRef = 8A33455F2BA499B7008C52AB /* disconnect-block-cookies-social.json */; };
8A33456A2BA499B7008C52AB /* disconnect-block-cryptomining.json in Resources */ = {isa = PBXBuildFile; fileRef = 8A3345602BA499B7008C52AB /* disconnect-block-cryptomining.json */; };
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll revert this, but I am not sure why this appears here.

Copy link
Contributor

@adudenamedruby adudenamedruby left a comment

Choose a reason for hiding this comment

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

@OrlaM is this the UnifiedAds work we were saying would be a good candidate to live in AS?

Comment on lines +28 to +29
private static let prodResourceEndpoint = "https://ads.mozilla.org/v1/ads"
static let stagingResourceEndpoint = "https://ads.allizom.org/v1/ads"
Copy link
Contributor

Choose a reason for hiding this comment

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

are we sure we want the ads urls public? Has this been discussed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mhh, so this one is public as the one is public in ContileProvider. It's public to be accessed by the unit tests. It's not a good reasons to make it public, so happy to change this. I guess I could duplicate it for unit tests if it's not public?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just asking that we're ok with that. For wallpapers, for example, it was explicitly not made public, so I'm just checking.

@lmarceau
Copy link
Contributor Author

@OrlaM is this the UnifiedAds work we were saying would be a good candidate to live in AS?

Yes it is. This work is to implement a short term solution in the meantime so we remain revenue compliant

@adudenamedruby
Copy link
Contributor

amazing! tyvm for providing more context!!! 👍

@mobiletest-ci-bot
Copy link

Messages
📖 Project coverage: 33.91%
📖 Edited 3 files
📖 Created 2 files

Client.app: Coverage: 31.87

File Coverage
ContileProvider.swift 92.21%
UnifiedAdsProvider.swift 82.41%

Generated by 🚫 Danger Swift against 2e3a01f

@lmarceau lmarceau merged commit 57009ea into main Nov 28, 2024
10 checks passed
@lmarceau lmarceau deleted the lm/FXIOS-10715-#23418-add-API branch November 28, 2024 21:25
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