PostHog / PostHog/posthog-flutter

Surveys: Support linkedFlagVariant for targeting specific feature flag variants

Open
#259 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Survey
Dominant language
Dart
Stars
97
Forks
85
Avg merge
1d 8h
Merged PRs (30d)
31

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:

  1. Get the actual flag value: flags[linkedFlagKey]
  2. Compare it to the variant: flagValue === linkedFlagVariant || linkedFlagVariant === "any"

Dependencies

This feature requires implementation in the native SDKs first:

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: https://github.com/PostHog/posthog/issues/45658

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reference implementation in packages/react-native/src/surveys/getActiveMatchingSurveys.ts, lines 77-83, then review the linked iOS and Android issues and the Flutter native SDK dependency versions. Done means the native SDKs support linkedFlagVariant and Flutter raises its minimum versions so surveys can target a specific variant or any variant.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.