Skip to content

Initial support for Feature Flags #670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

jaredmixpanel
Copy link
Contributor

No description provided.

@jaredmixpanel jaredmixpanel requested a review from Copilot April 22, 2025 18:40
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds initial support for feature flags by persisting flag data, integrating a feature flag manager into the instance, and updating configuration and initialization methods.

  • Added new keys and methods in MixpanelPersistence.swift to save/load flags.
  • Updated MixpanelInstance.swift to conform to FeatureFlagDelegate and integrate FeatureFlagManager.
  • Introduced a new MixpanelConfig class with flag configuration and updated initialization flows in Mixpanel.swift and the demo AppDelegate.

Reviewed Changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Sources/MixpanelPersistence.swift Added new key for flags and methods for archiving/unarchiving flag data.
Sources/MixpanelInstance.swift Integrated FeatureFlagManager and conformed to FeatureFlagDelegate.
Sources/MixpanelConfig.swift Introduced a new configuration class with flag support.
Sources/Mixpanel.swift Updated initialization methods to work with the new config and flags.
MixpanelDemo/MixpanelDemo/AppDelegate.swift Updated demo to initialize with MixpanelConfig including flags.
Files not reviewed (2)
  • Mixpanel.xcodeproj/project.pbxproj: Language not supported
  • MixpanelDemo/MixpanelDemo.xcodeproj/project.pbxproj: Language not supported
Comments suppressed due to low confidence (2)

Sources/Mixpanel.swift:21

  • The conditional block is redundant since both branches call the same initializer; simplifying this will improve code clarity.
if let proxyServerConfig = config.proxyServerConfig { return MixpanelManager.sharedInstance.initialize(config: config) } else { return MixpanelManager.sharedInstance.initialize(config: config) }

Sources/MixpanelPersistence.swift:201

  • The call to 'UserDefaults.synchronize()' is deprecated and may lead to unnecessary performance overhead; consider removing it to rely on the system's automatic synchronization.
defaults.synchronize()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant