Skip to content

Galaxy Attribution Fetcher#2917

Merged
fire-at-will merged 3 commits into
samsung-devfrom
galaxy-attribution-fetcher
Dec 12, 2025
Merged

Galaxy Attribution Fetcher#2917
fire-at-will merged 3 commits into
samsung-devfrom
galaxy-attribution-fetcher

Conversation

@fire-at-will

Copy link
Copy Markdown
Contributor

Description

Without an AttributionFetcher for the Galaxy Store, the SDK will crash at runtime when configured for the Galaxy Store, so we need to create one. Since the Samsung IAP SDK doesn't support fetching device identifiers, this PR creates a no-op GalaxyDeviceIdentifiersFetcher that always returns 0 identifiers, and wires it into the AttributionFetcherFactory.

@codecov

codecov Bot commented Dec 10, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.36%. Comparing base (2ce604f) to head (3db7de7).

Files with missing lines Patch % Lines
.../revenuecat/purchases/AttributionFetcherFactory.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           samsung-dev    #2917      +/-   ##
===============================================
- Coverage        78.36%   78.36%   -0.01%     
===============================================
  Files              337      338       +1     
  Lines            12986    12989       +3     
  Branches          1758     1758              
===============================================
+ Hits             10177    10179       +2     
- Misses            2070     2071       +1     
  Partials           739      739              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fire-at-will fire-at-will marked this pull request as ready for review December 10, 2025 19:32
@fire-at-will fire-at-will requested a review from a team as a code owner December 10, 2025 19:32
@fire-at-will fire-at-will added the pr:feat A new feature label Dec 10, 2025

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a simplification that I think would be nice to have

}
Store.GALAXY -> {
try {
Class.forName("com.revenuecat.purchases.galaxy.attribution.GalaxyDeviceIdentifiersFetcher")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm I understand this looks like this for Amazon, but looking at it, this seems to be a leftover from before we refactored the modules to have the amazon code be part of the purchases module as a compile only dependency.

Basically, I don't think we need to use reflection to instantiate this class since it will always be there (it's part of the same module) and we can just do GalaxyDeviceIdentifiersFetcher().

I think the same applies to the amazon one, but we can split that one in a separate PR to main.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the reflection for the GalaxyDeviceIdentifiersFetcher in 3db7de7

I'll remove it for Amazon in a follow-up PR into main to clean it up :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

PR to remove reflection from the Amazon instantiation here: #2919 :)

github-merge-queue Bot pushed a commit that referenced this pull request Dec 11, 2025
…2919)

### Description
Follow-up PR from [this comment
thread](#2917 (comment))
on PR #2917.

We no longer need to use reflection to instantiate the
`AmazonDeviceIdentifiersFetcher` class since it is now in the main
module of the SDK, so this PR changes the
`AmazonDeviceIdentifiersFetcher`'s instantiation from using reflection
to using a normal constructor.

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Makes sense 🚢 !

applicationContext: Application,
completion: (deviceIdentifiers: Map<String, String>) -> Unit,
) {
// Samsung IAP library doesn't support fetching device identifiers, so this is a no-op

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For Amazon, we also don't get this from their IAP library, but from the device settings. Is that something that would work for Galaxy devices? Can be done in a separate PR though of course!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I don't see why not! We can come back and do that in another PR, I think for now we've cut the device identifiers from the scope to ship quickly

@fire-at-will fire-at-will merged commit e9874f3 into samsung-dev Dec 12, 2025
4 of 19 checks passed
@fire-at-will fire-at-will deleted the galaxy-attribution-fetcher branch December 12, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants