- Notifications
You must be signed in to change notification settings - Fork 67
Description
Summary
The Flutter SDK does not support linkedFlagVariant for surveys. Since Flutter wraps the native iOS and Android SDKs, this depends on those SDKs implementing the feature first.
Current State
Flutter currently requires:
- iOS SDK: >= 3.38.0 (does not support linkedFlagVariant)
- Android SDK: >= 3.25.0 (does not support linkedFlagVariant)
The native SDKs only check if a linked feature flag is enabled (isFeatureEnabled), but do not support targeting users in a specific variant of that flag.
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"
Dependencies
This feature requires implementation in the native SDKs first:
- iOS: Surveys: Support linkedFlagVariant for targeting specific feature flag variants posthog-ios#445
- Android: Surveys: Support linkedFlagVariant for targeting specific feature flag variants posthog-android#388
Once implemented, Flutter will need to bump its minimum native SDK dependency versions.
Reference Implementation
See posthog-react-native: packages/react-native/src/surveys/getActiveMatchingSurveys.ts lines 77-83
Tracking
This is tracked in the survey SDK feature parity issue: PostHog/posthog#45658