feat: loadFlags and setContext support on all platforms#210
Merged
Conversation
efahk
approved these changes
Apr 8, 2026
Exposes the native SDK loadFlags() method through the Flutter plugin, enabling developers to manually trigger a fresh fetch of feature flag variant assignments from Mixpanel servers on iOS and Android. Web implementation logs a warning since the JS SDK lacks this method. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use the new completion-callback overloads of loadFlags on both iOS
(Swift SDK) and Android (Android SDK) so the Dart Future resolves
only after the fetch finishes. On failure, the native plugins now
return a FlutterError / PlatformException instead of silently
succeeding, enabling kill-switch and retry patterns in app code.
- iOS: flags.loadFlags { success in … }
- Android: flags.loadFlags(success -> …)
- Dart doc comment updated with error behaviour
- Tests added for both success and failure paths
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Android SDK 8.2.5 → 8.5.0, Swift SDK 5.1.3 → 6.2.0 - updateContext() now calls setContext on iOS and Android (was a no-op) - loadFlags() now supported on web via mixpanel.flags.load_flags() - Web updateContext/loadFlags properly await JS Promises Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Return error instead of success when loadFlags is called before Mixpanel is initialized on Android and iOS. Add updateContext success/error tests and async/await to loadFlags error test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dce8e66 to
828e4cd
Compare
The macOS podspec was still pinned to 6.1.0 which doesn't have the setContext method on MixpanelFlags, causing the macOS CI build to fail. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tylerjroach
approved these changes
Apr 8, 2026
Contributor
tylerjroach
left a comment
There was a problem hiding this comment.
Looks good to me. Will plan on getting osx support branch merged, then change the base here and mege.
tylerjroach
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
updateContext()now callssetContexton iOS and Android instead of being a no-op — context is replaced and flags are automatically re-fetchedloadFlags()now supported on web viamixpanel.flags.load_flags()updateContextandloadFlagsproperly await JS Promises before completing the Future🤖 Generated with Claude Code