dispatch_group_leave.cold.1 that would rarely occur as the SDK transitioned to an online state for a given configuration or user. This issue may have been exacerbated for a short period due to a temporary change in the behavior of the LaunchDarkly service streaming endpoint. Thanks to all the users who reported (#235).LDSwiftEventSource dependency to correct an issue where a streaming connection could sometimes reconnect after being set offline.FlagStore from LDUser to fix a bug where multiple environments could overwrite each other's flag values.LDConfig the ability to dynamically configure the HTTP headers on requests through the headerDelegate property, which has the type RequestHeaderTransform.LDUser now has an optional secondary attribute to match other LaunchDarkly SDKs. For more on the behavior of this attribute see the documentation on targeting users.LDUser.privateAttributes or LDConfig.privateUserAttributes properties.LDConfig.additionalHeaders. This feature is to enable certain proxy configurations, and is not needed for normal use.Note that this release contains the notes for the 5.0.0 release, which should not be used.
This major version has an accompanying Migration Guide. Please see the guide for more information on updating to this version of the SDK, as the following is just a summary of the changes.
LDConfig.setSecondaryMobileKeys and LDConfig.getSecondaryMobileKeys which allows configuring a mapping of names to the SDK keys for each additional environment. LDConfig.mobileKey is still required, and represents the primary environment.LDClient.get(environment: ) which allows retrieving an LDClient instance for a given environment after the SDK has been initialized.LDConfig and LDClient.LDConfig properties diagnosticOptOut and diagnosticRecordingInterval.LDConfig.wrapperName and LDConfig.wrapperVersion to send an additional header (X-LaunchDarkly-Wrapper) in requests to LaunchDarkly. This was added so that the usage of wrapper libraries (such as the React Native SDK) could be recorded independently.evaluationReasons field to the Objective-C bindings for LDConfig to allow configuring the SDK to request evaluation reasons when the application is written in Objective-C.LDInvalidArgumentError that is thrown on incorrect API usage.typeMismatch field to ObjcLD<T>ChangedFlag classes (bound to LD<T>ChangedFlag in Objective-C) that is true/YES when the flag value did not match the registered observer.LDClient instance method start has been replaced with a static method LDClient.start for initializing all configured environments.LDChangedFlag no longer includes the oldValueSource and newValueSource properties, as LDFlagValueSource was removed.LDClient.reportEvents() has been renamed to LDClient.flush().LDClient.stop() has been renamed to LDClient.close().LDClient.trackEvent(key: data: ) method have been renamed to LDClient.track(key: data: )LDClient.allFlagValues has been renamed to LDClient.allFlags.EvaluationDetail has been renamed to LDEvaluationDetail.ObjC<T>EvaluationDetail classes have been renamed to corresponding ObjcLD<T>EvaluationDetail. The names when exposed in Objective-C have been updated to replace the ObjC prefix with LD, e.g. ObjCStringEvaluationDetail to LDStringEvaluationDetail.LDClient.track no longer throws JSONError and instead throws LDInvalidArgumentError.fallback parameter of all LDClient and ObjcLDClient variation methods has been renamed to defaultValue to help distinguish it from fallback values in rules specified in the LaunchDarkly dashboard.LDClient.identify, LDClient.flush, LDClient.setOnline, and LDClient.close instance methods now operate on all configured environments. Any completion arguments will complete when the operation has completed for all configured environments.LDClient.shared static property and its ObjcLDClient.sharedInstance wrapper property has been removed. After calling LDClient.start, the initialized instances can be retrieved with LDClient.get(environment: ).LDClient.config and its ObjcLDClient.config wrapper property has been removed, configuration of the SDK should be done with LDClient.start.LDClient.user and its ObjcLDClient.user wrapper property has been removed. The initial user should be configured with LDClient.start, and updates to the user should be performed with LDClient.identify.LDFlagValueSource and ObjcLDFlagValueSource were removed in favor of using LDEvaluationDetail and ObjcLD<T>EvaluationDetail.ObjcLD<T>VariationValue (bound in Objective-C to LD<T>VariationValue), which wrapped a flag value and its source, have been removed.variationAndSource methods were removed from LDClient and its ObjcLDClient wrapper in favor of variationDetail methods.LDUser.init?(object: ) and corresponding ObjcLDUser failable initializers were removed.JSONError and JSONErrorDomain extensions on JSONSerialization were removed.isEqual extension to Array, this was only intended for internal SDK use.== and != extension to Optional<[String: Any]> (note that this was not declared as Equatable conformance). This extension was only intended for internal SDK use.LDFlagValue enum and the ObjcLDFlagValue wrapper which were exposed but not used in any public APIs.Sysctl struct (only available on macOS) which was only intended for internal SDK use.Please use the 5.0.1 instead. This release incorrectly specifies its version and is unavailable on CocoaPods.
startCompleteWhenFlagsReceived that accepts an additional argument specifying a maximum time to wait for flags to be received before calling the completion closure. The completion closure on this method will be passed a Bool on completion indication whether the operation timed out.maxCachedUsers option to LDConfig. You can now specify the number of users to be cached or use -1 for unlimited cached users.FlagStore properly synchronizes reads and writes to prevent a potential race condition.startCompleteWhenFlagsReceived function which contains modified completion behavior. This new function's completion will only return after flag values are received. Previously the start completion returned when the SDK went online.ios-eventsource version 4.1.0. This negates the need to use_frameworks! when using the React Native SDK. This change does not affect the iOS SDK.variationDetail which returns an Evaluation Reason giving developers greater insight into why a value was returned.track method now supports an additional metricValue parameter.identify function allows a completion to be called after a user is updated.ConnectionInformation that contains properties that keep track of the current connection mode e.g. streaming or polling, when and how a connection failed, and the last time flags were updated. This class can be accessed from LDClient.shared.getConnectionInformation.
• Additionally, a new observer function called observeCurrentConnectionMode allows your application to listen to changes in the SDK's connection to LaunchDarkly.user property is now deprecated in favor of the identify function.ios-eventsource version 4.0.2. This fixes a potential hang on LDClient start.ios-eventsource version 4.0.2. This fixes a potential hang on LDClient start.