-
Notifications
You must be signed in to change notification settings - Fork 1
Campaign tracking #8
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ec25752
Add campaign resolving case and call it from universal link
iggyto ccea2dc
Fixed v1_get_campaign url
sergihernanz 0b5518f
Created actor fpr waiting for url
sergihernanz efb6e8f
Add intent support
iggyto d57a202
Add intent to doc
iggyto bb8917d
Some work on tests
iggyto ea6baf2
Recover tests. Extract tests commented.
iggyto 44aaa74
Finalize tests. Campaign still missing
iggyto 91dbfad
Add tests for campaign API provider
iggyto 4290d8a
PR adjustments
iggyto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // | ||
| // CampaignResponse.swift | ||
| // traceback-ios | ||
| // | ||
| // Created by Nacho Sánchez on 10/24/25. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| struct CampaignResponse: Decodable, Equatable, Sendable { | ||
| let result: URL? | ||
| let error: String? | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // | ||
| // CampaignTracker.swift | ||
| // Traceback | ||
| // | ||
| // Created by Nacho Sanchez on 24/10/25. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| class CampaignTracker { | ||
| private let userDefaults: UserDefaults | ||
| private let seenCampaignsKey = "_traceback_seen_campaigns" | ||
|
|
||
| init(userDefaults: UserDefaults = .standard) { | ||
iggyto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| self.userDefaults = userDefaults | ||
| } | ||
|
|
||
| // Get all seen campaigns | ||
| private func getSeenCampaigns() -> Set<String> { | ||
| if let campaigns = userDefaults.array(forKey: seenCampaignsKey) as? [String] { | ||
| return Set(campaigns) | ||
| } | ||
| return Set() | ||
| } | ||
|
|
||
| // Save seen campaigns | ||
| private func saveSeenCampaigns(_ campaigns: Set<String>) { | ||
| userDefaults.set(Array(campaigns), forKey: seenCampaignsKey) | ||
| } | ||
|
|
||
| // Check if campaign has been seen before | ||
| func hasSeenCampaign(_ campaign: String) -> Bool { | ||
| return getSeenCampaigns().contains(campaign) | ||
| } | ||
|
|
||
| // Mark campaign as seen | ||
| func markCampaignAsSeen(_ campaign: String) { | ||
| var campaigns = getSeenCampaigns() | ||
| campaigns.insert(campaign) | ||
| saveSeenCampaigns(campaigns) | ||
| } | ||
|
|
||
| // Check and mark in one operation (returns true if first time) | ||
| func isFirstTimeSeen(_ campaign: String) -> Bool { | ||
| let isFirstTime = !hasSeenCampaign(campaign) | ||
| if isFirstTime { | ||
| markCampaignAsSeen(campaign) | ||
| } | ||
| return isFirstTime | ||
| } | ||
|
|
||
| // Clear all seen campaigns (useful for testing) | ||
| func clearSeenCampaigns() { | ||
| userDefaults.removeObject(forKey: seenCampaignsKey) | ||
| } | ||
| } | ||
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.