ObjcLDConfig

@objc(LDConfig)
public final class ObjcLDConfig : NSObject

Use LDConfig to configure the LDClient. When initialized, a LDConfig contains the default values which can be changed as needed.

The client app can change the LDConfig by getting the config from LDClient (ObjcLDClient), adjusting the values, and setting it back into the LDClient (ObjcLDClient).

  • 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

    @objc
    public var mobileKey: String { get set }
  • The url for making feature flag requests. Do not change unless instructed by LaunchDarkly.

    Declaration

    Swift

    @objc
    public var baseUrl: URL { get set }
  • The url for making event reports. Do not change unless instructed by LaunchDarkly.

    Declaration

    Swift

    @objc
    public var eventsUrl: URL { get set }
  • The url for connecting to the clientstream. Do not change unless instructed by LaunchDarkly.

    Declaration

    Swift

    @objc
    public var streamUrl: URL { get set }
  • 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

    @objc
    public var eventCapacity: Int { get set }
  • The timeout interval for flag requests and event reports. (Default: 10 seconds)

    Declaration

    Swift

    @objc
    public var connectionTimeout: TimeInterval { get set }
  • The time interval between event reports (Default: 30 seconds)

    Declaration

    Swift

    @objc
    public var eventFlushInterval: TimeInterval { get set }
  • Undocumented

    Declaration

    Swift

    @objc
    public var sendEvents: Bool { get set }
  • The interval between feature flag requests. Used only for polling mode. (Default: 5 minutes)

    Declaration

    Swift

    @objc
    public var flagPollingInterval: TimeInterval { get set }
  • The interval between feature flag requests while running in the background. Used only for polling mode. (Default: 60 minutes)

    Declaration

    Swift

    @objc
    public var backgroundFlagPollingInterval: TimeInterval { get set }
  • The application info meta data.

    Declaration

    Swift

    @objc
    public var applicationInfo: ObjcLDApplicationInfo { get set }
  • The minimum interval between feature flag requests. Used only for polling mode. (5 minutes)

    Declaration

    Swift

    @objc
    public var minFlagPollingInterval: TimeInterval { get }
  • The minimum interval between feature flag requests while running in the background. Used only for polling mode. (15 minutes)

    Declaration

    Swift

    @objc
    public var minBackgroundFlagPollInterval: TimeInterval { get }
  • Controls the method the SDK uses to keep feature flags updated. When set to .streaming, connects to clientstream which notifies the SDK of feature flag changes. When set to .polling, an efficient polling mechanism is used to periodically request feature flag values. Ignored for watchOS, which always uses .polling. See LDStreamingMode for more details. (Default: .streaming)

    Declaration

    Swift

    @objc
    public var streamingMode: Bool { get set }
  • Enables feature flag updates when your app is in the background. Allowed on macOS only. (Default: NO)

    Declaration

    Swift

    @objc
    public var enableBackgroundUpdates: Bool { get set }
  • Controls LDClient start behavior. When YES, calling start causes LDClient to go online. When NO, calling start causes LDClient to remain offline. If offline at start, set the client online to receive flag updates. (Default: YES)

    Declaration

    Swift

    @objc
    public var startOnline: Bool { get set }
  • 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 YES, ignores values in either LDConfig.privateContextAttributes or LDContext.privateAttributes. (Default: NO)

    See Also: privateContextAttributes and LDContext.privateAttributes (ObjcLDContext.privateAttributes)

    Declaration

    Swift

    @objc
    public var allContextAttributesPrivate: Bool { get set }
  • 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 (ObjcLDContext.privateAttributes). (Default: [])

    See Also: allContextAttributesPrivate and LDContext.privateAttributes (ObjcLDContext.privateAttributes).

    Declaration

    Swift

    @objc
    public var privateContextAttributes: [String] { get set }
  • Directs the SDK to use REPORT for HTTP requests to connect to clientstream and make feature flag requests. When NO the SDK uses GET for these requests. Do not use unless advised by LaunchDarkly. (Default: NO)

    Declaration

    Swift

    @objc
    public var useReport: Bool { get set }
  • Enables logging for debugging. (Default: NO)

    Declaration

    Swift

    @objc
    public var debugMode: Bool { get set }
  • Enables requesting evaluation reasons for all flags. (Default: NO)

    Declaration

    Swift

    @objc
    public var evaluationReasons: Bool { get set }
  • An Integer that tells ContextEnvironmentFlagCache the maximum number of contexts to locally cache. Can be set to -1 for unlimited cached contexts. (Default: 5)

    Declaration

    Swift

    @objc
    public var maxCachedContexts: Int { get set }
  • 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

    @objc
    public var diagnosticOptOut: Bool { get set }
  • The interval between sending periodic diagnostic data. (Default: 15 minutes)

    Declaration

    Swift

    @objc
    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 these wrapper libraries.

    Declaration

    Swift

    @objc
    public var wrapperName: String? { get set }
  • 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 verison strill will be included with the wrapperName in the “X-LaunchDarkly-Wrapper” header on requests to the LaunchDarkly servers.

    Declaration

    Swift

    @objc
    public var wrapperVersion: String? { get set }
  • Configure the logger that will be used by the rest of the SDK.

    Declaration

    Swift

    @objc
    public var logger: OSLog { get set }
  • Returns a Dictionary of identifying names to unique mobile keys to access secondary environments.

    Declaration

    Swift

    @objc
    public func getSecondaryMobileKeys() -> [String : String]

    Return Value

    A Dictionary of String to String.

  • Sets a Dictionary of identifying names to unique mobile keys to access secondary environments in the LDConfig. Throws if you try to add duplicate keys or put the primary key or name in secondaryMobileKeys.

    Declaration

    Swift

    @objc
    public func setSecondaryMobileKeys(_ keys: [String : String]) throws

    Parameters

    keys

    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 (ObjcLDClient.config) in order to retain previously set values.

    Declaration

    Swift

    @objc
    public init(mobileKey: String, autoEnvAttributes: AutoEnvAttributes)
  • Compares the settable properties in 2 LDConfig structs

    Declaration

    Swift

    @objc
    public func isEqual(object: Any?) -> Bool