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 }
  • 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 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 user attributes as private for event reporting for all users.

    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.privateUserAttributes or LDUser.privateAttributes. (Default: NO)

    See Also: privateUserAttributes and LDUser.privateAttributes (ObjcLDUser.privateAttributes)

    Declaration

    Swift

    @objc
    public var allUserAttributesPrivate: Bool { get set }
  • User attributes and top level custom dictionary keys to treat as private for event reporting for all users.

    The SDK will not include private attribute values in analytics events, but private attribute names will be sent.

    See LDUser.privatizableAttributes (ObjcLDUser.privatizableAttributes) for the attribute names that can be declared private. To set private user attributes for a specific user, see LDUser.privateAttributes (ObjcLDUser.privateAttributes). (Default: nil)

    See Also: allUserAttributesPrivate, LDUser.privatizableAttributes (ObjcLDUser.privatizableAttributes), and LDUser.privateAttributes (ObjcLDUser.privateAttributes).

    Declaration

    Swift

    @objc
    public var privateUserAttributes: [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 }
  • Controls how the SDK reports the user in analytics event reports. When set to YES, event reports will contain the user attributes, except attributes marked as private. When set to NO, event reports will contain the user’s key only, reducing the size of event reports. (Default: NO)

    Declaration

    Swift

    @objc
    public var inlineUserInEvents: 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 UserEnvironmentFlagCache the maximum number of users to locally cache. Can be set to -1 for unlimited cached users. (Default: 5)

    Declaration

    Swift

    @objc
    public var maxCachedUsers: 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 }
  • 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)
  • Compares the settable properties in 2 LDConfig structs

    Declaration

    Swift

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