Releases: launchdarkly/ios-client-sdk
Releases · launchdarkly/ios-client-sdk
[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.setSecondaryMobileKeys
andLDConfig.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.- Equivalent methods have been added to the Objective-C bindings for
LDConfig
andLDClient
.
- 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
LDConfig
propertiesdiagnosticOptOut
anddiagnosticRecordingInterval
. - The SDK can now be configured with
LDConfig.wrapperName
andLDConfig.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. - Added the
evaluationReasons
field to the Objective-C bindings forLDConfig
to 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.
LDInvalidArgumentError
that is thrown on incorrect API usage.- Added
typeMismatch
field toObjcLD<T>ChangedFlag
classes (bound toLD<T>ChangedFlag
in Objective-C) that istrue
/YES
when 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
LDClient
instance methodstart
has been replaced with a static methodLDClient.start
for initializing all configured environments. LDChangedFlag
no longer includes theoldValueSource
andnewValueSource
properties, asLDFlagValueSource
was 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.allFlagValues
has been renamed toLDClient.allFlags
.EvaluationDetail
has been renamed toLDEvaluationDetail
.- The
ObjC<T>EvaluationDetail
classes have been renamed to correspondingObjcLD<T>EvaluationDetail
. The names when exposed in Objective-C have been updated to replace theObjC
prefix withLD
, e.g.ObjCStringEvaluationDetail
toLDStringEvaluationDetail
.
LDClient.track
no longer throwsJSONError
and instead throwsLDInvalidArgumentError
.- The
fallback
parameter of allLDClient
andObjcLDClient
variation methods has been renamed todefaultValue
to help distinguish it fromfallback
values 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.close
instance methods now operate on all configured environments. Any completion arguments will complete when the operation has completed for all configured environments.
Removed
- The
LDClient.shared
static property and itsObjcLDClient.sharedInstance
wrapper property has been removed. After callingLDClient.start
, the initialized instances can be retrieved withLDClient.get(environment: )
. - The
LDClient.config
and itsObjcLDClient.config
wrapper property has been removed, configuration of the SDK should be done withLDClient.start
. - The
LDClient.user
and itsObjcLDClient.user
wrapper property has been removed. The initial user should be configured withLDClient.start
, and updates to the user should be performed withLDClient.identify
. LDFlagValueSource
andObjcLDFlagValueSource
were removed in favor of usingLDEvaluationDetail
andObjcLD<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. variationAndSource
methods were removed fromLDClient
and itsObjcLDClient
wrapper in favor ofvariationDetail
methods.LDUser.init?(object: )
and correspondingObjcLDUser
failable initializers were removed.JSONError
andJSONErrorDomain
extensions onJSONSerialization
were removed.- Removed
isEqual
extension toArray
, this was only intended for internal SDK use. - Removed
==
and!=
extension toOptional<[String: Any]>
(note that this was not declared asEquatable
conformance). This extension was only intended for internal SDK use. - Removed
LDFlagValue
enum and theObjcLDFlagValue
wrapper which were exposed but not used in any public APIs. - Removed
Sysctl
struct (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
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 aBool
on completion indication whether the operation timed out.
[4.6.0] - 2020-05-26
Added
- Added
maxCachedUsers
option toLDConfig
. You can now specify the number of users to be cached or use-1
for unlimited cached users.
Fixed
FlagStore
properly synchronizes reads and writes to prevent a potential race condition.
[4.5.0] - 2020-03-26
Changed
- Updated SDK code to build, run, and test on Xcode 11.4.
[4.4.1] - 2020-02-04
Changed
- The SDK will now retry an event send once when the initial request fails.
[4.4.0] - 2019-12-19
Added
- Added
startCompleteWhenFlagsReceived
function which contains modified completion behavior. This new function's completion will only return after flag values are received. Previously thestart
completion returned when the SDK went online. - The SDK now specifies a uniquely identifiable request header when sending events to LaunchDarkly to ensure that events are only processed once, even if the SDK sends them two times due to a failed initial attempt.
[4.3.2] - 2019-12-19
Fixed
- Flag change listeners will now be called when a flag value changes but a variation number does not change. Previously, flag listeners were not called when a value assigned to a variation was manually edited in the dashboard or via the API.
[4.3.1] - 2019-12-12
Changed
- Updated to
ios-eventsource
version4.1.0
. This negates the need touse_frameworks!
when using the React Native SDK. This change does not affect the iOS SDK.
[4.3.0] - 2019-12-3
Added
- Implemented
variationDetail
which returns an Evaluation Reason giving developers greater insight into why a value was returned. - Added support for the latest Experimentation features allowing increased value from A/B/n testing. The
track
method now supports an additionalmetricValue
parameter.