Skip to content

Keep the Google Advertising ID per SDK instance - #61

Closed
jrosendahl-opt wants to merge 1 commit into
masterfrom
fix/gaid-per-instance
Closed

jrosendahl-opt wants to merge 1 commit into
masterfrom
fix/gaid-per-instance

Conversation

@jrosendahl-opt

Copy link
Copy Markdown
Contributor

Why

GoogleAdIdManager kept the ad ID and the Limit Ad Tracking flag in a companion object, shared by every OptableSDK instance. An instance created with skipAdvertisingIdDetection = true, for example after the user withdrew consent, still sent the GAID an earlier instance had read, until the process restarted. A Limit Ad Tracking value read by one instance also overwrote every other instance's.

What Changed

  • android_sdk: GoogleAdIdManager keeps adId and limitAdTracking per instance instead of in a companion object. Every instance already fetched on creation, so the shared state saved nothing.
  • android_sdk: GoogleAdIdManagerTest drops the reflection reset of the companion fields and adds tests that a skip instance returns no GAID after another instance read one, and that one instance's Limit Ad Tracking value doesn't affect another.

How to Test

  • ./gradlew test passes (162 tests locally)
  • Verified in DemoAppJava / DemoAppKotlin
  • README updated (if public API changed)

Notes

#60 documents the fixed behaviour and should merge after this and the GAID timeout fix.

  • Breaking change
  • Requires release

🤖 Generated with Claude Code

GoogleAdIdManager kept the ad ID and the Limit Ad Tracking flag in a
companion object, shared by every OptableSDK instance. An instance created
with skipAdvertisingIdDetection = true, for example after the user
withdrew consent, still sent the GAID an earlier instance had read, until
the process restarted.

Keep both per instance. Every instance already fetched on creation, so the
shared state saved nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant