All notable changes to the LaunchDarkly React Native SDK will be documented in this file. This project adheres to Semantic Versioning.
LDUser
now has an optionalsecondary
attribute to match other LaunchDarkly SDKs. For more on the behavior of this attribute see the documentation on targeting users.- Support for multiple LaunchDarkly projects or environments. Each set of feature flags associated with a mobile key is called an environment. (#10)
secondaryMobileKeys
is now a config option which allows a mapping of names to the SDK keys for each additional environment.mobileKey
is still required, and represents the primary environment.- Many methods including variations, track, and listeners now support an optional
environment
parameter to evaluate the method against the givenenvironment
.
- The
LDEvaluationReasonErrorKind
,LDEvaluationReasonKind
,LDConnectionMode
, andLDFailureReason
enum TypeScript types were undefined when evaluated at runtime due to being defined in an ambient context. This was also fixed in SDK version 4.0.3 with React Native 0.63 compatibility.
- The
LDEvaluationReasonErrorKind
,LDEvaluationReasonKind
,LDConnectionMode
, andLDFailureReason
enum TypeScript types were undefined when evaluated at runtime due to being defined in an ambient context.
- Android: Fixed an issue where the
jsonVariationDetail
method inLDClient
returnedPromise<Record<string, any>>
instead of the declared return type ofPromise<LDEvaluationDetail<Record<string, any>>>
. This was also fixed in SDK version 4.0.2 with React Native 0.63 compatibility.
- Android: Fixed an issue where the
jsonVariationDetail
method inLDClient
returnedPromise<Record<string, any>>
instead of the declared return type ofPromise<LDEvaluationDetail<Record<string, any>>>
.
- The SDK is now compatible with React Native version 0.64.x. (#69)
- The SDK no longer requires React as a peer dependency. React compatibility is dictated based on its compatibility with the React Native version.
- iOS: 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 therefore delay the completion of the returned Promise.
- Added
getConnectionMode
,getLastSuccessfulConnection
,getLastFailedConnection
, andgetLastFailure
methods toLDClient
. These methods can be used to report on the SDK's connection to LaunchDarkly. The newLDConnectionMode
andLDFailureReason
enum types have been added to support these methods. These methods replace thegetConnectionInformation
method which behaved differently across platforms. - Added a
getVersion
method toLDClient
to get the version of the React Native SDK. - Added an optional
timeout
value to theconfigure
method to specify that the SDK should block up to a specified duration while initializing. - Added a new client configuration option,
maxCachedUsers
, toLDClientConfig
. You can now specify the number of users to be cached locally on the device or use-1
for unlimited cached users. - Added new user configuration options,
ip
andavatar
, toLDUserConfig
. - 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
LDClientConfig
propertiesdiagnosticOptOut
anddiagnosticRecordingInterval
. - Added reporting of the SDK's "wrapper name" and "wrapper version" for internal reporting purposes.
- iOS: Added XCode 12 support (#64)
- iOS: Added support for the
isInitialized
method. Previously this method only worked when running on Android.
- Renamed the
LDClientConfig
type toLDConfig
for consistency with other LaunchDarkly SDKs. Corresponding parameter names and documentation have also been updated to reflect this change. - Renamed the
LDUserConfig
type toLDUser
for consistency with other LaunchDarkly SDKs. Corresponding parameter names and documentation have also been updated to reflect this change. - Renamed
baseUri
inLDConfig
(formerlyLDClientConfig
) topollUri
to clarify that this URI is only used when polling. - The
fallback
parameter of allLDClient
variation methods has been renamed todefaultValue
to help distinguish it fromfallback
values in rules specified in the LaunchDarkly dashboard. - Changed the default polling domain from
app.launchdarkly.com
toclientsdk.launchdarkly.com
. - Android: Updated the Android SDK native module from 2.10.0 to 2.14.1
- Android: Error stacktrace logging in the bridge layer now uses Timber instead of
System.err
- iOS: Updated the iOS SDK native module from 4.5.0 to 5.4.0 (#65)
- iOS: The minimum iOS deployment target has been updated from 8.0 to 10.0.
- iOS: 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.
- iOS: 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.
- iOS: When sending events to LaunchDarkly, the SDK will now retry the request after a one second delay if it fails.
- iOS: 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
getConnectionInformation
method inLDClient
had inconsistent return types across the iOS and Android platforms. This API has been split into separate methods which are consistently typed across platforms - see the notes above. (#59) - Android: Fixed an issue where
identify
ran on the current thread instead of on a background thread (thanks, orthanc and hackdie!) - Android: Fixed an issue where an exception was thrown if
configure
was invoked multiple times. Now, subsequent invocations result in a rejected promise. (#40) - Android: Fixed an issue where the
evaluationReasons
option inLDClientConfig
was not used when configuring the Android SDK native module. - Android: Fixed an issue where
NullPointerException
s were possible if certain methods were invoked while the client was initializing (discussed in #55) - Android: Fixed an issue where initialization may never complete if the network status of foreground state changed before the future had completed.
- Android: Fixed an issue where a
NullPointerException
could occur when calling a variation method with a flag key that does not exist locally or is of the wrong type. This issue could only occur if a null fallback value was provided. - Android: Improved event summarization logic to avoid potential runtime exceptions.
- Android: 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 therefore delay the completion of the returned Promise. - Android: Previously, the SDK manifest required the SET_ALARM permission. This permission was never used, so it has been removed.
- Android: Improved handling of exceptions thrown by the alarm manager on Samsung devices.
- iOS: Fixed an issue preventing private custom attribute names being recorded in events when all custom attributes are set to be private by including "custom" in the
LDUserConfig.privateAttributeNames
orLDClientConfig.allUserAttributesPrivate
properties. - iOS: Fixed an issue to prevent a crash 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.
- OS: Fix
metricValue
argument totrack
to work with all numbers.
- Removed the
LDClientConfig
type. - Removed the
LDUserConfig
type. - Removed the
getConnectionInformation
method inLDClient
. - Removed the
isDisableBackgroundPolling
method inLDClient
. - Removed the
baseUri
attribute inLDConfig
(formerlyLDClientConfig
).
- Changed iOS all flags listener to only return
[LDFlagKey]
instead of[LDFlagKey: LDChangedFlag]
. (#61)
isInitialized
was failing when run in Android due to accessing an undefined variable. (#55)
- The SDK is now compatible with React Native version 0.63.x and React version 16.13.x.
- The SDK no longer supports iOS 9. This change was made to correspond to React Native 0.63's dropped support for iOS 9.
- The
track
method failed when called with a booleandata
value and a non-nullmetricValue
. (Thanks, bolak!)
- Updated the Android target and compile versions to 28
- The SDK is now compatible with React Native version 0.62.x and React version 16.11.x
- Updated SDK code to build, run, and test on Xcode 11.4.
- Generated TypeDoc documentation for all types, properties, and methods is now available online at https://launchdarkly.github.io/react-native-client-sdk/. Currently this will only be for the latest released version.
- Fixed some incorrect and incomplete typedoc comments.
- Added TypeScript type definitions (thanks, eeynard!)
- Added TypeDoc comments
- 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.
- Changed the default value for the
anonymous
user property has been changed tofalse
. Previously this default was inconsistent; the default value wastrue
when running in iOS andfalse
when running in Android. - Changed the default value for the
backgroundPollingIntervalMillis
SDK configuration property has been changed to3600000
(one hour). Previously this default was inconsistent; the default value was900000
(15 minutes) when running in iOS and3600000
(one hour) when running in Android. - Changed the default value for the
disableBackgroundUpdating
SDK configuration property has been changed tofalse
. Previously this default was inconsistent; the default value wastrue
when running in iOS andfalse
when running in Android.
- Fixed the
*VariationDetail
methods so that they now always return a promise containing the variation detail information. Previously, when running in Android, this promise would have instead contained just the variation value if the underlying process threw an exception. - Fixed an issue where React Native apps could crash after reloading when running in iOS (thanks, shercoder!)
- Adds
evaluationReasons
configuration option. - Adds
user.country
user option.
- Fixes iOS start completion by adding new method
startCompleteWhenFlagsReceived
. This change creates feature parity between the start completion on iOS and Android. They now both complete when flag values are received. - Fixes
EvaluationDetail
parsing from native to JS.
- Implemented
variationDetail
which returns an Evaluation Reason giving developers greater insight into why a value was returned. - Added
allFlagsListener
method, this returns flag keys whenever any flag key is updated. - Added
metricValue
parameter totrack
method. - The Connection Status API allows greater introspection into the current LaunchDarkly connection and the health of local flags.
- This feature adds a new method called
getConnectionInformation
that returns an object that contains the current connection mode e.g. streaming or polling, when and how a connection failed, and the last time flags were updated. - Additionally, a new observer function called
registerCurrentConnectionModeListener
allows your application to listen to changes in the SDK's connection to LaunchDarkly.
- This feature adds a new method called
- A
close()
method which flushes the event queue and closes all open connections to LaunchDarkly. This method should be invoked as part of your application's termination lifecycle event.
- Updated the iOS SDK to version 4.3.2. This enables the removal of
use_frameworks!
from the Podfile in a project using the LaunchDarkly React Native SDK. - Updated the Android SDK to version 2.9.0.
- Switched iOS user switching from the deprecated
user
object to theidentify
method.
- The SDK's dependency on React Native has been expanded to include subsequent patch releases after
0.61.2
.
- The Android package is properly namespaced now as
com.launchdarkly.reactnative
. Previously the Android module's package wascom.reactlibrary
which was prone to clash with other third-party modules' packages. (#25)
- Updated React Native to version 0.61.2 and updated React to version 16.9.0
- Listeners on Android now have the proper event emitter key and work properly.
- Flag values in the object returned by
allFlags
will no longer be Strings when they should be JSON Objects on Android.
- Updated Android Client SDK to version 2.8.5
- Updated iOS Client SDK to version 4.1.2
- Changes polling mode to not be ignored in config.
- Updated Android Client SDK to version 2.8.4
- Updated iOS Client SDK to version 4.1.0
- Updated React Native to version 0.59.9 and updated React to version 16.8.3
- Updated to allow usage with Xcode 10.2.1
- Updated Swift to version 5.0
This is a major version because of breaking version updates.
- Changed the package name from
launchdarkly-react-native-client
tolaunchdarkly-react-native-client-sdk
- Changed repository references to use the new URL
There are no other changes in this release. Substituting launchdarkly-react-native-client
version 1.0.0 with launchdarkly-react-native-client-sdk
version 1.0.1 will not affect functionality.
- Android and iOS client versions
- Added correct anonymous property
- Removed dependencies and added caret to peer dependencies
The LaunchDarkly SDK repositories are being renamed for consistency. This repository is now react-native-client-sdk
rather than react-native-client
.
The package name will also change. In the 1.0.0 release, it is still launchdarkly-react-native-client
; in all future releases, it will be launchdarkly-react-native-client-sdk
.
- CHANGELOG.md and CONTRIBUTING.md
- Moved
LaunchDarklyReactNativeClient.podspec
intoios/
- Changed
config.yml
to run againsthello-react-native
.