Summary
The Android SDK does not support linkedFlagVariant for surveys. Currently, the SDK only checks if a linked feature flag is enabled (isFeatureEnabled), but does not support targeting users in a specific variant of that flag.
Current State
In PostHogSurveysIntegration.kt, the survey matching logic (line ~203) only checks:
val featureFlagsMatch = allKeys.all { postHog.isFeatureEnabled(it) }
This is a boolean check that verifies the flag is enabled, but ignores the linkedFlagVariant condition.
Expected Behavior
When a survey has conditions.linkedFlagVariant set (e.g., "variant-a"), the SDK should:
- Get the actual flag value:
flags[linkedFlagKey]
- Compare it to the variant:
flagValue === linkedFlagVariant || linkedFlagVariant === "any"
Reference Implementation
See posthog-react-native: packages/react-native/src/surveys/getActiveMatchingSurveys.ts lines 77-83:
const linkedFlagVariant = survey.conditions?.linkedFlagVariant
let linkedFlagVariantCheck = true
if (linkedFlagVariant) {
linkedFlagVariantCheck = survey.linked_flag_key
? flags[survey.linked_flag_key] === linkedFlagVariant || linkedFlagVariant === ANY_FLAG_VARIANT
: true
}
Tracking
This is tracked in the survey SDK feature parity issue: PostHog/posthog#45658
Summary
The Android SDK does not support
linkedFlagVariantfor surveys. Currently, the SDK only checks if a linked feature flag is enabled (isFeatureEnabled), but does not support targeting users in a specific variant of that flag.Current State
In
PostHogSurveysIntegration.kt, the survey matching logic (line ~203) only checks:This is a boolean check that verifies the flag is enabled, but ignores the
linkedFlagVariantcondition.Expected Behavior
When a survey has
conditions.linkedFlagVariantset (e.g., "variant-a"), the SDK should:flags[linkedFlagKey]flagValue === linkedFlagVariant || linkedFlagVariant === "any"Reference Implementation
See posthog-react-native:
packages/react-native/src/surveys/getActiveMatchingSurveys.tslines 77-83:Tracking
This is tracked in the survey SDK feature parity issue: PostHog/posthog#45658