Releases: launchdarkly/ios-client-sdk
Releases · launchdarkly/ios-client-sdk
[5.4.1] - 2021-04-06
Fixed
- Internal throttling logic would sometimes delay new poll or stream connections even when there were no recent connections. This caused switching active user contexts using
identifyto sometimes delay retrieving the most recent flags and calling the completion.
[5.4.0] - 2021-02-26
Added
- Added the
aliasmethod toLDClient. This can be used to associate two user objects for analytics purposes with an alias event. - Added the
autoAliasingOptOutconfiguration option. This can be used to control the new automatic aliasing behavior of theidentifymethod; by settingautoAliasingOptOutto true,identifywill not automatically generate alias events. - Added the
isInitializedproperty toLDClient. Unless the client has been set offline, this property's value isfalseuntil the client receives an initial set of flag values from the LaunchDarkly service. If the client is offline, the value will betrueafter initialization.
Changed
- The
identifymethod will now automatically generate an alias event when switching from an anonymous to a known user. This event associates the two users for analytics purposes as they most likely represent a single person.
Fixed
- Some users reported synchronization issues with the internal
DiagnosticReporterimplementation, which has been reworked to address these issues. Thanks to @provanandparanjape for one such report (#238).
[5.3.2] - 2021-02-11
Fixed
- Updated to prevent a crash in
dispatch_group_leave.cold.1that 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). - Updated
LDSwiftEventSourcedependency to correct an issue where a streaming connection could sometimes reconnect after being set offline.
[5.3.1] - 2020-12-15
Fixed
- Decoupled
FlagStorefromLDUserto fix a bug where multiple environments could overwrite each other's flag values.
[5.3.0] - 2020-11-06
Added
- Adds to
LDConfigthe ability to dynamically configure the HTTP headers on requests through theheaderDelegateproperty, which has the typeRequestHeaderTransform.
[5.2.0] - 2020-10-09
Added
LDUsernow has an optionalsecondaryattribute to match other LaunchDarkly SDKs. For more on the behavior of this attribute see the documentation on targeting users.
Fixed
- Corrected a bug preventing private custom attribute names being recorded in events when all custom attributes are set to be private by including "custom" in the
LDUser.privateAttributesorLDConfig.privateUserAttributesproperties. - Update Nimble to 9.0 and Quick to 3.0 to fix tests when run with Swift 5.3.
- Fixes build warnings in Xcode 12.0.0.
[5.1.0] - 2020-08-04
Added
- The ability to specify additional headers to be included on HTTP requests to LaunchDarkly services using
LDConfig.additionalHeaders. This feature is to enable certain proxy configurations, and is not needed for normal use. - Support for building docs with jazzy. These docs will be available through GitHub Pages.
Fixed
- SDK causing nested bundles in archived product when including the SDK through Carthage. This caused rejections when submitted to the App Store. Thanks to @spr for reporting (#217).
- SDK causing application to expect LDSwiftEventSource dynamic framework when built with SwiftPM, which does not include the dynamic framework in the resulting application. This causes the application to be rejected when submitted to the App Store. Thanks to @spr for reporting (#216).
[5.0.1] - 2020-07-23
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.
Added
- Support for multiple LaunchDarkly projects or environments. Each set of feature flags associated with a mobile key is called an environment. This adds:
LDConfig.setSecondaryMobileKeysandLDConfig.getSecondaryMobileKeyswhich allows configuring a mapping of names to the SDK keys for each additional environment.LDConfig.mobileKeyis 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.- Equivalent methods have been added to the Objective-C bindings for
LDConfigandLDClient.
- The SDK now periodically sends diagnostic data to LaunchDarkly, describing the version and configuration of the SDK, the operating system the SDK is running on, the device type (such as "iPad"), and performance statistics. No credentials, device IDs, or other identifiable values are included. This behavior can be disabled or configured with the new
LDConfigpropertiesdiagnosticOptOutanddiagnosticRecordingInterval. - The SDK can now be configured with
LDConfig.wrapperNameandLDConfig.wrapperVersionto 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. - Added the
evaluationReasonsfield to the Objective-C bindings forLDConfigto allow configuring the SDK to request evaluation reasons when the application is written in Objective-C. - The SDK now supports using the Swift Package Manager to include the SDK as a dependency.
LDInvalidArgumentErrorthat is thrown on incorrect API usage.- Added
typeMismatchfield toObjcLD<T>ChangedFlagclasses (bound toLD<T>ChangedFlagin Objective-C) that istrue/YESwhen the flag value did not match the registered observer.
Changed (build)
- Minimum deployment targets have been changed as follows:
- iOS 8.0 -> 10.0
- macOS 10.10 -> 10.12
- tvOS 9.0 -> 10.0
- watchOS 2.0 -> 3.0
- The SDK has replaced the internal dependency on the Objective-C eventsource implementation DarklyEventSource with a pure Swift implementation LDSwiftEventSource. Build configurations that manually specify the DarklyEventSource dependency framework may require additional upgrade steps. See the Migration Guide for more information.
- Internally, the SDK no longer includes its dependencies using CocoaPods and Carthage. This simplifies including the SDK as a subproject of your application for integrating the SDK without a package manager.
Changed (API)
- The
LDClientinstance methodstarthas been replaced with a static methodLDClient.startfor initializing all configured environments. LDChangedFlagno longer includes theoldValueSourceandnewValueSourceproperties, asLDFlagValueSourcewas removed.- The following were renamed for consistency internally and with other SDKs:
LDClient.reportEvents()has been renamed toLDClient.flush().LDClient.stop()has been renamed toLDClient.close().LDClient.trackEvent(key: data: )method have been renamed toLDClient.track(key: data: )LDClient.allFlagValueshas been renamed toLDClient.allFlags.EvaluationDetailhas been renamed toLDEvaluationDetail.- The
ObjC<T>EvaluationDetailclasses have been renamed to correspondingObjcLD<T>EvaluationDetail. The names when exposed in Objective-C have been updated to replace theObjCprefix withLD, e.g.ObjCStringEvaluationDetailtoLDStringEvaluationDetail.
LDClient.trackno longer throwsJSONErrorand instead throwsLDInvalidArgumentError.- The
fallbackparameter of allLDClientandObjcLDClientvariation methods has been renamed todefaultValueto help distinguish it fromfallbackvalues in rules specified in the LaunchDarkly dashboard.
Changed (behavioral)
- The maximum backoff delay between failed streaming connections has been reduced from an hour to 30 seconds. This is to prevent being unable to receive new flag values for up to an hour if the SDK has reached its maximum backoff due to a period of network connectivity loss.
- The backoff on streaming connections will not be reset after just a successful connection, rather waiting for a healthy connection for one minute after receiving flags. This is to reduce congestion in poor network conditions or if extreme load prevents the LaunchDarkly service from maintaining an active streaming connection.
- When sending events to LaunchDarkly, the SDK will now retry the request after a one second delay if it fails.
- When events fail to be sent to LaunchDarkly, the SDK will no longer retain the events. This prevents double recording events when the LaunchDarkly service received the event but the SDK failed to receive the acknowledgement.
- The
LDClient.identify,LDClient.flush,LDClient.setOnline, andLDClient.closeinstance methods now operate on all configured environments. Any completion arguments will complete when the operation has completed for all configured environments.
Removed
- The
LDClient.sharedstatic property and itsObjcLDClient.sharedInstancewrapper property has been removed. After callingLDClient.start, the initialized instances can be retrieved withLDClient.get(environment: ). - The
LDClient.configand itsObjcLDClient.configwrapper property has been removed, configuration of the SDK should be done withLDClient.start. - The
LDClient.userand itsObjcLDClient.userwrapper property has been removed. The initial user should be configured withLDClient.start, and updates to the user should be performed withLDClient.identify. LDFlagValueSourceandObjcLDFlagValueSourcewere removed in favor of usingLDEvaluationDetailandObjcLD<T>EvaluationDetail.- The Objective-C wrapper classes
ObjcLD<T>VariationValue(bound in Objective-C toLD<T>VariationValue), which wrapped a flag value and its source, have been removed. variationAndSourcemethods were removed fromLDClientand itsObjcLDClientwrapper in favor ofvariationDetailmethods.LDUser.init?(object: )and correspondingObjcLDUserfailable initializers were removed.JSONErrorandJSONErrorDomainextensions onJSONSerializationwere removed.- Removed
isEqualextension toArray, this was only intended for internal SDK use. - Removed
==and!=extension toOptional<[String: Any]>(note that this was not declared asEquatableconformance). This extension was only intended for internal SDK use. - Removed
LDFlagValueenum and theObjcLDFlagValuewrapper which were exposed but not used in any public APIs. - Removed
Sysctlstruct (only available on macOS) which was only intended for internal SDK use.
[5.0.0] - 2020-07-23
Please use the 5.0.1 instead. This release incorrectly specifies its version and is unavailable on CocoaPods.
[4.7.0] - 2020-06-03
Added
- Added a new method signature for
startCompleteWhenFlagsReceivedthat 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 aBoolon completion indication whether the operation timed out.