Releases: launchdarkly/ios-client-sdk
Releases · launchdarkly/ios-client-sdk
[6.0.0] - 2022-05-04
This major version has accompanying migration guides for Swift and Objective-C. 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.
Note that Objective-C bridging types are prefixed by Objc
, but that prefix is not exposed to code written in Objective-C. For example, changes listed to ObjcLDClient
are changes to the class referred to as LDClient
from within Objective-C.
Added
- Added the
LDValue
class to represent any data type that is allowed in JSON. This new type is used to provide more type safety when representing complex or non-statically determined data types. The SDK also provides the bridge typesObjcLDValue
andObjcLDValueType
for Objective-C interoperability. - Added the
UserAttribute
class which provides a less error-prone way to refer to user attribute names in configuration. - Added the type specific variation functions,
boolVariation
,intVariation
,doubleVariation
,stringVariation
, andjsonVariation
, toLDClient
. - Added the type specific detailed variation functions,
boolVariationDetail
,intVariationDetail
,doubleVariationDetail
,stringVariationDetail
, andjsonVariationDetail
, toLDClient
. - Added
jsonVariation
andjsonVariationDetail
toObjcLDClient
. These functions allow evaluating feature flags where the provideddefaultValue
and the resulting variation can be any valid JSON data type. - Added
ObjcLDJSONEvaluationDetail
for retrieving the detailed evaluation information of arbitrary type flag variations. - Added
ObjcLDChangedFlagHandler
type alias for new non-type specific Objective-C flag observers.
Changed (API)
LDClient.track(key: data: metricValue:)
no longerthrows
.- The type of the
data
parameter ofLDClient.track(key: data: metricValue:)
has changed fromAny?
toLDValue?
. ObjcLDClient.track(key: data:)
andObjcLDClient.track(key: data: metricValue:)
no longerthrows
. In Objective-C this change means that thetrack
functions no longer accept aerror:
parameter.- The type of the
data
parameter ofObjcLDClient.track(key: data:)
andObjcLDClient.track(key: data: metricValue)
has changed fromAny?
toObjLDValue?
. In Objective-C this would be a change fromid _Nullable
toLDValue * _Nullable
. LDClient.allFlags
now has the type[LDFlagKey: LDValue]?
rather than[LDFlagKey: Any]?
.ObjcLDClient.allFlags
now has the type[String: ObjcLDValue]?
rather than[String: Any]?
. In Objective-C this would be a change fromNSDictionary<NSString*, id> * _Nullable
toNSDictionary<NSString*, LDValue*> * _Nullable
.- The type of the
LDUser.custom
dictionary, and the correspondingLDUser.init
parameter has been changed from[String: Any]?
to[String: LDValue]
. - The type of the
ObjcLDUser.custom
property has been changed from[String: Any]?
to[String: ObjcLDValue]
. In Objective-C this would be a change fromNSDictionary<NSString*, id> * _Nullable
toNSDictionary<NSString*, LDValue*> * _Nonnull
. - The type of the
LDUser.privateAttributes
property, and the correspondingLDUser.init
parameter, have been changed from[String]?
to[UserAttribute]
. - The type of the
ObjcLDUser.privateAttributes
property has been changed from[String]?
to[String]
. In Objective-C this would be a change fromNSArray<NSString*> * _Nullable
toNSArray<NSString*> * _Nonnull
. - The types of the properties
LDChangedFlag.oldValue
andLDChangedFlag.newValue
have been changed fromAny?
toLDValue
. - The type of the
LDConfig.privateUserAttributes
property has been changed from[String]?
to[UserAttribute]
. ObjcLDConfig.privateUserAttributes
now has the non-optional type[String]
rather than[String]?
. In Objective-C this would be a change fromNSArray<NSString*> * _Nullable
toNSArray<NSString*> * _Nonnull
.- The type of the
LDEvaluationDetail.reason
property has been changed from[String: Any]
to[String: LDValue]
. - The type of the
reason
property ofObjcLDBoolEvaluationDetail
,ObjcLDIntegerEvaluationDetail
,ObjcLDDoubleEvaluationDetail
, andObjcLDStringEvaluationDetail
has been changed from[String: Any]?
to[String: ObjcLDValue]?
. In Objective-C this would be a change fromNSDictionary<NSString*, id> * _Nullable
toNSDictionary<NSString*, LDValue*> * _Nullable
.
Changed (behavioral)
- The
Equatable
instance forLDUser
has been changed to compare all user properties, rather than just thekey
property. - Using
"custom"
as a private attribute name inLDConfig.privateUserAttributes
orLDUser.privateAttributes
will no longer set allLDUser
custom attributes private. - The automatically set
device
andoperatingSystem
custom attributes can now be set private. - SDK versions from 4.0.0 and less than 6.0.0 supported migration of cached flag data from any SDK version of at least 2.3.3. The 6.0.0 release only supports migration of cached flag data from SDK versions of at least 4.0.0.
Removed
- Removed
LDClient.variation(forKey: defaultValue:)
andLDClient.variationDetail(forKey: defaultValue:)
functions. Please use the new type-specific variation functions instead (e.g.LDClient.boolVariation(forKey: defaultValue:)
). - Removed the
LDFlagValueConvertible
protocol which was previously used to constrain the parameters and return types of the variation functions. LDErrorHandler
andLDClient.observeError(owner: handler:)
have been removed. Please useConnectionInformation
instead.- Removed the
LDUser.init(userDictionary: )
andObjcLDUser.init(userDictionary: )
initializers, please use the explicit initializers instead. - Removed
LDUser.CodingKeys
. To refer to user attributes, please useUserAttribute
instead. - Removed
LDUser.privatizableAttributes
andObjcLDUser.privatizableAttributes
. - Removed
ObjcLDUser.attributeCustom
. - The
LDUser.device
andLDUser.operatingSystem
properties, and the correspondingLDUser.init
parameters have been removed. These fields will be included in theLDUser.custom
dictionary. - The
ObjcLDUser.device
andObjcLDUser.operatingSystem
properties have been removed. These fields will be included in theObjcLDUser.custom
dictionary. - The
ObjcLDClient
functions,arrayVariation
,arrayVariationDetail
,dictionaryVariation
, anddictionaryVariationDetail
, have been removed. Please useObjcLDClient.jsonVariation
andObjcLDClient.jsonVariationDetail
instead. - The per-type instances of
ObjcLDChangedFlag
have been removed. Please use the base classObjcLDChangedFlag
, which now providesoldValue
andnewValue
ObjcLDValue
properties. The removed classes areObjcLDBoolChangedFlag
,ObjcLDIntegerChangedFlag
,ObjcLDDoubleChangedFlag
,ObjcLDStringChangedFlag
,ObjcLDArrayChangedFlag
, andObjcLDDictionaryChangedFlag
. - The classes
ObjcLDArrayEvaluationDetail
andObjcLDDictionaryEvaluationDetail
have been removed. Please useObjcLDJSONEvaluationDetail
instead. - The type aliases,
ObjcLDBoolChangedFlagHandler
,ObjcLDIntegerChangedFlagHandler
,ObjcLDDoubleChangedFlagHandler
,ObjcLDStringChangedFlagHandler
,ObjcLDArrayChangedFlagHandler
, andObjcLDDictionaryChangedFlagHandler
, have been removed. Please useObjcLDChangedFlagHandler
instead. - The
ObjcLDClient
functions,observeBool
,observeInteger
,observeDouble
,observeString
,observeArray
, andobserveDictionary
, have been removed. Please use the non-type specificObjcLDClient.observe(key: owner: handler:)
instead.
[5.4.5] - 2022-03-11
Fixed
- Fixed race condition in
LDSwiftEventSource
that could cause a crash if the stream is explicitly stopped (such as whenidentify
is called) while the stream is waiting to reconnect.
[5.4.4] - 2022-01-19
Fixed
- Fixed memory leak when stream connections are terminated by updating
LDSwiftEventSource
dependency to 1.3.0. - The SDK would not allow additional fields on
delete
flag stream events. This has been updated to allow additional fields for improved future compatibility. - Improved internal
Throttler
implementation to reduce concurrency concerns. - Removed unneeded
Cartfile
definingLDSwiftEventSource
dependency, which when bundled could lead to warning messages thatLDSwiftEventSource
definitions are implemented in multiple frameworks.
[5.4.3] - 2021-08-13
Fixed
- Fixed an issue where
304 NOT_MODIFIED
responses to SDK polling mode requests would be considered error responses. This could cause the completion on aidentify
request to not complete, and gave erroneous connection information data and logging output. - Fixed a crash when attempting to cache flag data containing variation JSON values containing a JSON
null
value nested within a JSON array.
[5.4.2] - 2021-06-17
Fixed
- Avoid crash when
TimeInterval
configuration options are set to sufficiently large values. This was caused when converting these values to anInt
value of milliseconds. (Thanks, @delannoyk!) - Update
Package.swift
to use SwiftPM tools version 5.2. This prevents test dependencies from being included transitively. (Thanks, @escakot!) - Update
Quick
test dependency to 3.1.2 to avoid build warnings and adopt security fixes. (#243) - Use
AnyObject
overclass
in protocol inheritance to avoid compiler warnings. (#247) - Improve CI to test against multiple supported Xcode and Swift language versions.
- Restored test suite compatibility with Xcode 11.4 and Swift 5.2.
[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
identify
to sometimes delay retrieving the most recent flags and calling the completion.
[5.4.0] - 2021-02-26
Added
- Added the
alias
method toLDClient
. This can be used to associate two user objects for analytics purposes with an alias event. - Added the
autoAliasingOptOut
configuration option. This can be used to control the new automatic aliasing behavior of theidentify
method; by settingautoAliasingOptOut
to true,identify
will not automatically generate alias events. - Added the
isInitialized
property toLDClient
. Unless the client has been set offline, this property's value isfalse
until the client receives an initial set of flag values from the LaunchDarkly service. If the client is offline, the value will betrue
after initialization.
Changed
- The
identify
method 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
DiagnosticReporter
implementation, 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.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). - Updated
LDSwiftEventSource
dependency to correct an issue where a streaming connection could sometimes reconnect after being set offline.
[5.3.1] - 2020-12-15
Fixed
- Decoupled
FlagStore
fromLDUser
to fix a bug where multiple environments could overwrite each other's flag values.
[5.3.0] - 2020-11-06
Added
- Adds to
LDConfig
the ability to dynamically configure the HTTP headers on requests through theheaderDelegate
property, which has the typeRequestHeaderTransform
.