LDConfig
public struct LDConfig
extension LDConfig: Equatable
Use LDConfig to configure the LDClient. When initialized, a LDConfig contains the default values which can be changed as needed.
-
The minimum values allowed to be set into LDConfig.
See moreDeclaration
Swift
public struct Minima
-
The Mobile key from your LaunchDarkly Account settings (on the left at the bottom). If you have multiple projects be sure to choose the correct Mobile key.
Declaration
Swift
public var mobileKey: String
-
The base url for making feature flag requests. Do not change unless instructed by LaunchDarkly.
Declaration
Swift
public var baseUrl: URL
-
The base url for making event reports. Do not change unless instructed by LaunchDarkly.
Declaration
Swift
public var eventsUrl: URL
-
The base url for connecting to the streaming service. Do not change unless instructed by LaunchDarkly.
Declaration
Swift
public var streamUrl: URL
-
Whether to send events back to LaunchDarkly. This differs from {#offline?} in that it affects only the sending of client-side events, not streaming or polling for events from the server.
Declaration
Swift
public var sendEvents: Bool
-
The maximum number of analytics events the LDClient can store. When the LDClient event store reaches the eventCapacity, the SDK discards events until it successfully reports them to LaunchDarkly. (Default: 100)
Declaration
Swift
public var eventCapacity: Int
-
The timeout interval for flag requests and event reports. (Default: 10 seconds)
Declaration
Swift
public var connectionTimeout: TimeInterval
-
The time interval between event reports (Default: 30 seconds)
Declaration
Swift
public var eventFlushInterval: TimeInterval
-
The time interval between feature flag requests. Used only for polling mode. (Default: 5 minutes)
Declaration
Swift
public var flagPollingInterval: TimeInterval
-
The time interval between feature flag requests while running in the background. Used only for polling mode. (Default: 60 minutes)
Declaration
Swift
public var backgroundFlagPollingInterval: TimeInterval
-
The configuration for application metadata.
Declaration
Swift
public var applicationInfo: ApplicationInfo?
-
Controls the method the SDK uses to keep feature flags updated. (Default:
.streaming
)See
LDStreamingMode
for more details.Declaration
Swift
public var streamingMode: LDStreamingMode
-
Enables feature flag updates when your app is in the background. Allowed on macOS only. (Default: false)
Declaration
Swift
public var enableBackgroundUpdates: Bool { get set }
-
Controls LDClient start behavior. When true, calling start causes LDClient to go online. When false, calling start causes LDClient to remain offline. If offline at start, set the client online to receive flag updates. (Default: true)
Declaration
Swift
public var startOnline: Bool
-
Treat all context attributes as private for event reporting for all contexts.
The SDK will not include private attribute values in analytics events, but private attribute names will be sent.
When true, ignores values in either LDConfig.privateContextAttributes or LDContext.privateAttributes. (Default: false)
See Also:
privateContextAttributes
andLDContext.privateAttributes
Declaration
Swift
public var allContextAttributesPrivate: Bool
-
Context attributes and top level custom dictionary keys to treat as private for event reporting for all contexts.
The SDK will not include private attribute values in analytics events, but private attribute names will be sent.
To set private context attributes for a specific context, see
LDContext.privateAttributes
. (Default: nil)See Also:
allContextAttributesPrivate
andLDContext.privateAttributes
.Declaration
Swift
public var privateContextAttributes: [Reference]
-
Directs the SDK to use REPORT for HTTP requests for feature flag data. (Default:
false
)This setting applies both to requests to the streaming service, as well as flag requests when the SDK is in polling mode. When false the SDK uses GET for these requests. Do not use unless advised by LaunchDarkly.
Declaration
Swift
public var useReport: Bool
-
Enables logging for debugging. (Default: false)
Declaration
Swift
public var isDebugMode: Bool
-
Enables requesting evaluation reasons for all flags. (Default: false)
Declaration
Swift
public var evaluationReasons: Bool
-
An Integer that tells ContextEnvironmentFlagCache the maximum number of contexts to locally cache. Can be set to -1 for unlimited cached contexts.
Declaration
Swift
public var maxCachedContexts: Int
-
Set to true to opt out of sending diagnostic data. (Default: false)
Unless the diagnosticOptOut field is set to true, the client will send some diagnostics data to the LaunchDarkly servers in order to assist in the development of future SDK improvements. These diagnostics consist of an initial payload containing some details of the SDK in use, the SDK’s configuration, and the platform the SDK is being run on; as well as payloads sent periodically with information on irregular occurrences such as dropped events.
Declaration
Swift
public var diagnosticOptOut: Bool
-
The interval between sending periodic diagnostic data. (Default: 15 minutes)
Declaration
Swift
public var diagnosticRecordingInterval: TimeInterval { get set }
-
For use by wrapper libraries to set an identifying name for the wrapper being used. This will be sent in the “X-LaunchDarkly-Wrapper” header on requests to the LaunchDarkly servers to allow recording metrics on the usage of wrapper libraries. (Default: nil)
Declaration
Swift
public var wrapperName: String?
-
For use by wrapper libraries to report the version of the library in use. If the
wrapperName
has not been set this field will be ignored. Otherwise the version string will be included with thewrapperName
in the “X-LaunchDarkly-Wrapper” header on requests to the LaunchDarkly servers. (Default: nil)Declaration
Swift
public var wrapperVersion: String?
-
Additional headers that should be added to all HTTP requests from SDK components to LaunchDarkly services
Declaration
Swift
public var additionalHeaders: [String : String]
-
Should the event payload sent to LaunchDarkly use gzip compression. By default this is false to prevent backward breaking compatibility issues with older versions of the relay proxy.
Customers not using the relay proxy are strongly encouraged to enable this feature to reduce egress bandwidth cost.
Declaration
Swift
public var enableCompression: Bool
-
a closure to allow dynamic changes of headers on connect & reconnect
Declaration
Swift
public var headerDelegate: RequestHeaderTransform?
-
Set to true to opt in to automatically sending mobile environment attributes. This data makes it simpler to target mobile customers based on application name or version, or on device characteristics including manufacturer, model, operating system, locale, and so on.
Declaration
Swift
public var autoEnvAttributes: Bool
-
Configure the logger that will be used by the rest of the SDK.
Declaration
Swift
public var logger: OSLog
-
LaunchDarkly defined minima for selected configurable items
Declaration
Swift
public let minima: Minima
-
An NSObject wrapper for the Swift LDConfig struct. Intended for use in mixed apps when Swift code needs to pass a config into an Objective-C method.
Declaration
Swift
public var objcLdConfig: ObjcLDConfig { get }
-
Initial set of hooks for the client.
Hooks provide entry points which allow for observation of SDK functions.
Declaration
Swift
public var hooks: [Hook]
-
Sets a Dictionary of identifying names to unique mobile keys to access secondary environments in the LDConfig. Throws
LDInvalidArgumentError
if you try to add duplicate keys or put the primary key or name in secondaryMobileKeys.Declaration
Swift
public mutating func setSecondaryMobileKeys(_ newSecondaryMobileKeys: [String : String]) throws
Parameters
newSecondaryMobileKeys
A Dictionary of String to String.
-
Returns a Dictionary of identifying names to unique mobile keys to access secondary environments.
Declaration
Swift
public func getSecondaryMobileKeys() -> [String : String]
Return Value
A Dictionary of String to String.
-
LDConfig constructor. Configurable values are all set to their default values. The client app can modify these values as desired. Note that client app developers may prefer to get the LDConfig from
LDClient.config
in order to retain previously set values.- mobileKey: The mobile key for the LaunchDarkly environment. This can be found on the LaunchDarkly dashboard once logged in.
- autoEnvAttributes: Enable / disable Auto Environment Attributes functionality. When enabled, the SDK will automatically provide data about the mobile environment where the application is running. This data makes it simpler to target your mobile customers based on application name or version, or on device characteristics including manufacturer, model, operating system, locale, and so on. We recommend enabling this when you configure the SDK. To learn more, read Automatic environment attributes. for more documentation.
Declaration
Swift
public init(mobileKey: String, autoEnvAttributes: AutoEnvAttributes)
-
Compares the settable properties in 2 LDConfig structs
Declaration
Swift
public static func == (lhs: LDConfig, rhs: LDConfig) -> Bool