diff --git a/.changeset/device-bucketing.md b/.changeset/device-bucketing.md index e224592b..f90efdb0 100644 --- a/.changeset/device-bucketing.md +++ b/.changeset/device-bucketing.md @@ -1,5 +1,6 @@ --- "posthog": minor +"posthog-android": minor --- feat: add device bucketing support for stable feature flag assignment across identity changes diff --git a/posthog/src/main/java/com/posthog/PostHog.kt b/posthog/src/main/java/com/posthog/PostHog.kt index 15df15a5..ff02aba2 100644 --- a/posthog/src/main/java/com/posthog/PostHog.kt +++ b/posthog/src/main/java/com/posthog/PostHog.kt @@ -177,13 +177,13 @@ public class PostHog private constructor( legacyPreferences(config, config.serializer) + super.enabled = true + // Initialize device_id if not already set. getDeviceId() handles lazy init // by seeding from the anonymous ID, providing a stable identifier for // device-level feature flag bucketing that survives identify() and reset(). getDeviceId() - super.enabled = true - queue.start() startSession()