MixpanelFlagVariant
public struct MixpanelFlagVariant : Decodable
Undocumented
-
Undocumented
Declaration
Swift
public let key: String -
Undocumented
Declaration
Swift
public let value: Any? -
Undocumented
Declaration
Swift
public let experimentID: String? -
Undocumented
Declaration
Swift
public let isExperimentActive: Bool? -
Undocumented
Declaration
Swift
public let isQATester: Bool? -
Where this variant was sourced from. Always non-nil — every
MixpanelFlagVariantcarries a definite source..fallbackfor developer-supplied fallback instances;.networkor.persistence(persistedAt:)when the SDK serves a variant. For persisted variants, the timestamp lives on the.persistencecase so invalid combinations like “network with a timestamp” are unrepresentable.Declaration
Swift
public let source: Source -
Identifies where a served variant came from.
See moreDeclaration
Swift
public enum Source -
Why the SDK returned the developer fallback.
Network/cache SDKs (like the iOS/macOS Mixpanel SDK) cannot distinguish “flag does not exist” from “user is not in any rollout” without server-side cooperation — both surface as
See more.flagNotFoundfor now. Future server changes can add a more specific reason without breaking callers that already switch on this enum.Declaration
Swift
public enum FallbackReason : Equatable, Hashable, Sendable -
Declaration
Swift
public init(from decoder: Decoder) throws -
Undocumented
Declaration
Swift
public init( key: String = "", value: Any? = nil, isExperimentActive: Bool? = nil, isQATester: Bool? = nil, experimentID: String? = nil ) -
Initializer that stamps a served (or fallback) variant with its origin. Used both internally (by
withSourcewhen re-tagging a decoded variant) and by tests/callers constructing variants with explicit source metadata.Declaration
Swift
public init( key: String, value: Any?, experimentID: String? = nil, isExperimentActive: Bool? = nil, isQATester: Bool? = nil, source: Source ) -
Returns a copy of this variant stamped with the given source. Other fields are preserved.
Public so callers (and tests) can re-tag variants with explicit source metadata — the SDK uses this internally to stamp the reason a developer-supplied fallback was returned.
Declaration
Swift
public func withSource(_ source: Source) -> MixpanelFlagVariant
View on GitHub
Install in Dash