All notable changes to the LaunchDarkly React Native SDK will be documented in this file. This project adheres to Semantic Versioning.
- iOS: Using "custom" as a private attribute name in
LDConfig.privateAttributeNamesorLDUser.privateAttributeNameswill no longer set allLDUsercustom attributes private. - iOS: The automatically set
deviceandoperatingSystemcustom attributes can now be set private. - iOS: Significant internal changes from updating to the 6.0.0 release of the iOS SDK.
- The TypeScript definitions for
LDClient.jsonVariationandLDClient.jsonVariationDetailno longer restrict thedefaultValueand result type toRecord<string, any>. These methods can acceptanyfordefaultValueand returnanytype.
- React Native 0.68 Support
- Android:
variationDetailmethods return the correct variation when the reason is not present - Android: The object returned by
variationDetailmethods will now include theinExperimentfield when appropriate. - ManualTestApp Int and Float options now work correctly
- Android: Prevent multiple allocations of the
DiagnosticEventProcessor.
- iOS: Fixed race condition in
LDSwiftEventSourcethat could cause a crash if the stream is explicitly stopped (such as whenidentifyis called) while the stream is waiting to reconnect.
- Added
privateAttributeNamesconfiguration option forLDConfigallowing the configuration of private attributes for all users. (#102)
- Android: Updated Android SDK dependency to 3.1.3.
- Android: Added missing native module API stubs to prevent warning on
NativeEventEmitter. (#116) - iOS: Fixed ownership handling of native callbacks to avoid garbage collection of all flags and connection mode listeners that are still in use. (#106)
- Expanded supported versions of React Native to include 0.65, 0.66, and 0.67 releases.
- Added a manual testing application to the repository.
- Extensive testing of build configurations in CI to allow quicker validation of compatibility against multiple React Native releases and XCode versions.
- iOS: The native
podspecfor iOS has been renamed to fix automatic linking. Updating may require removing references to the oldpodspec.
- iOS: Fixed an issue that prevented using
jsonVariationandjsonVariationDetailwith array default values. (#112)
- Support for React Native 0.63.
- The
keyproperty onLDUserobjects is now optional, if it is not provided the SDK will automatically generate a key and mark the user as anonymous. See the API documentation for more details. - Updated native Android and iOS SDK to the 3.1.2 release and 5.4.4 release respectively.
- Android: Removed reference of
jcenterfrom the Gradle build to reflect the shutdown of the JCenter artifact repository. - iOS:
isOfflinehas been corrected to no longer returntruewhen online andfalsewhen offline. - iOS: Fixed memory leak when stream connections are terminated caused by the native server sent events implementation.
- Added the
inlineUsersInEventsconfiguration option which can be used to configure the SDK to include full user details in all analytics events.
- Restored compatibility with React Native 0.63, this version of the SDK can be used with either 0.63 or 0.64 React Native releases.
- Added missing TypeScript definition for
autoAliasingOptOutconfiguration field. - Fixed an outdated
LDClient#isInitializeddescription (Thanks, christophby!)
- Android: Fixed an inconsistency in the argument type given to all flags listeners. On Android the callback was given a string with a JSON representation of an array of strings, rather than an actual array of strings. (Thanks, rodperottoni!) (#89)
- Android: Fixed runtime crashes caused by code shrinking when compiling with Proguard/R8. The SDK now specifies consumer Proguard rules for Android SDK methods accessed with runtime reflection.
- Android: Removed the
android:allowBackuptag from the SDK'sAndroidManifest.xmlfile to avoid requiring applications to explicitly replace the tag if given a different value. (#138) - Android: Changed the SDK's network detection check to consider network transport over a VPN as a connected state. This fixes an issue where the SDK would prevent network requests on a VPN due to considering the network to be unavailable. (Thanks, lguipeng!)
- The SDK now supports the ability to control the proportion of traffic allocation to an experiment. This works in conjunction with a new platform feature now available to early access customers.
- Added
numberVariationandnumberVariationDetailto LDClient. - Added the
aliasmethod to LDClient. 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. - Improved testing of JavaScript wrapper using mock native modules.
- iOS: The underlying SDK version has been updated from 5.4.1 to 5.4.3. See the release notes for details.
- Android: The underlying SDK version has been updated from 2.14.1 to 3.1.0. See the release notes for details.
- Android: Migrated from using the Android Support Libraries to using AndroidX from Jetpack.
- Android: The minimum API version has been raised from API level 16 (Android 4.1 Jelly Bean) to API level 21 (Android 5.0 Lollipop).
- Android: The SDK no longer has a dependency on Google Play Services. This dependency was only used on pre-21 Android API levels to improve TLS 1.2 compatibility, as the minimum Android version has been raised to 21, the dependency is no longer necessary.
- Android: The SDK is now built with modern Gradle (6.7, Android plugin 4.1.3) and uses Java 8.
- The
LDClient.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. This behavior can be disabled with theautoAliasingOptOutconfiguration option. - The
LDClient<type>Variationand<type>VariationDetailmethods (e.g.boolVariation) now validate that default values are the correct type. If the default value fails validation thePromisewill be rejected. - The primitive variation methods,
LDClient.boolVariation,LDClient.boolVariationDetail,LDClient.numberVariation, andLDClient.numberVariationDetail, now require a default value parameter (rather than being optional). If missing, thePromisewill be rejected. - Android:
LDClient.allFlagswill no longer convertStringflags into JSONArrays orObjects when the value can be parsed into JSONArrays orObjects. - Android: For compatibility with older SDK behavior, the
LDClient.stringVariationmethod could be used to retrieve JSON flags in a serialized representation. This compatibility behavior has been removed, and attempts to request a JSON valued flag using stringVariation will behave the same as other mismatched type variation calls. - Android: All log messages are now tagged
LaunchDarklySdkfor easier filtering. Thanks to @valeriyo for the suggestion (#113). - Android: The when the
countryuser is set, the SDK will no longer attempt to look up the country from the providedString(attempting to match it as an ISO-3166-1 alpha-2, alpha-3 code; or a country name) and set the country to the resultant IOS-3166-1 alpha-2 only if successful. The SDK no longer gives this attribute special behavior, and sets the user's country attribute directly as the providedString. - Android: If the
debugModeconfiguration option is set totrue, the SDK will now enable detailed timber logging. - Android: Custom user attributes that are
Objects will no longer be ignored. - Android: Elements of
Arraycustom user attributes will no longer be ignored if they are notStrings orNumbers. - Android:
Arraycustom user attributes with mixed types will no longer ignore non-Stringelements.
- Catch
SecurityExceptionwhen thrown on call togetNetworkCapabilitiesused to detect current network availability. (#129) - Explicitly flag
PendingIntents asFLAG_IMMUTABLEon Android SDK versions that support doing so. Explicitly specifying mutability is required when targeting Android S+. (#133) - Increased the compile-time dependency on
jackson-databindto 2.10.5.1, due to CVE-2020-25649. - Update the dependency on the shared launchdarkly/java-sdk-common to 1.1.2 to prevent Jackson from showing up as a transitive dependency in tools that inspect module metadata.
- The Android manifest has been updated to explicitly specify the
android:exportedattribute on declaredreceiverelements. This is to meet new requirements in the upcoming Android 12 release. - Fixed an issue where the SDK could log error level messages when attempting to send diagnostic events without an internet connection. The SDK will no longer attempt to send diagnostic events when an internet connection is known to be unavailable, and will not log an error level message if the connection fails. Thanks to @valeriyo for reporting (#107).
- Fixed an issue where flags listeners would be informed of changes to unchanged flags whenever the SDK receives an entire flag set (on a new stream connection, a poll request, or any stream updates behind a relay proxy).
- Fixed an issue where a
NullPointerExceptionis thrown ifLDClient.close()is called multiple times. - Improved the proguard/R8 configuration to allow more optimization. Thanks to @valeriyo for requesting (#106)
- Fixed a potential issue where the SDK could cause additional throttling on requests to the backend service when previously throttled requests had been cancelled before completion.
- Fixed an issue where
304 NOT_MODIFIEDresponses to SDK polling mode requests would be considered error responses. This could cause the completion on aidentifyrequest 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
nullvalue nested within a JSON array. - Avoid crash when timeout/interval configuration options are set to sufficiently large values. This was caused when converting these values to an
Intvalue of milliseconds. (Thanks, @delannoyk!) - Update
Quicktest dependency to 3.1.2 to avoid build warnings and adopt security fixes. (#243) - Use
AnyObjectoverclassin protocol inheritance to avoid compiler warnings. (#247)
LDClient.intVariationandLDClient.floatVariation. Please useLDClient.numberVariationinstead.LDClient.intVariationDetailandLDClient.floatVariationDetail. Please useLDClient.numberVariationDetailinstead.
- Correct usages of undeclared variables when registering or un-registering connection mode or all flags listeners. (#82)
- iOS: Fixed an issue where an exception was thrown when calling
LDClient.configurewith an optionaltimeout(#80).
- iOS: Fixed an issue where an exception was thrown when calling
LDClient.configurewith an optionaltimeout(#80). - iOS: Improved consistency with Android for
LDClient.isInitialized. Both implementations will now reject the promise if the client has not been configured. - iOS: Avoid exceptions on iOS when certain methods are called after
LDClient.close. (Thanks, andvalsol)! (#75) - Android: Fixed an issue where the promise for
LDClient.configurecould be resolved before the client had finished initializing when not providing the optionaltimeoutparameter. - Android: Fixed an issue where
LDClient.allFlagswould reject the promise when the client was configured but not yet initialized, rather than resolving with any cached flags.
LDUsernow has an optionalsecondaryattribute 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)
secondaryMobileKeysis now a config option which allows a mapping of names to the SDK keys for each additional environment.mobileKeyis still required, and represents the primary environment.- Many methods including variations, track, and listeners now support an optional
environmentparameter to evaluate the method against the givenenvironment.
- The
LDEvaluationReasonErrorKind,LDEvaluationReasonKind,LDConnectionMode, andLDFailureReasonenum 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, andLDFailureReasonenum TypeScript types were undefined when evaluated at runtime due to being defined in an ambient context.
- Android: Fixed an issue where the
jsonVariationDetailmethod inLDClientreturnedPromise<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
jsonVariationDetailmethod inLDClientreturnedPromise<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
identifyto sometimes delay retrieving the most recent flags, and therefore delay the completion of the returned Promise.
- Added
getConnectionMode,getLastSuccessfulConnection,getLastFailedConnection, andgetLastFailuremethods toLDClient. These methods can be used to report on the SDK's connection to LaunchDarkly. The newLDConnectionModeandLDFailureReasonenum types have been added to support these methods. These methods replace thegetConnectionInformationmethod which behaved differently across platforms. - Added a
getVersionmethod toLDClientto get the version of the React Native SDK. - Added an optional
timeoutvalue to theconfiguremethod 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-1for unlimited cached users. - Added new user configuration options,
ipandavatar, 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
LDClientConfigpropertiesdiagnosticOptOutanddiagnosticRecordingInterval. - 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
isInitializedmethod. Previously this method only worked when running on Android.
- Renamed the
LDClientConfigtype toLDConfigfor consistency with other LaunchDarkly SDKs. Corresponding parameter names and documentation have also been updated to reflect this change. - Renamed the
LDUserConfigtype toLDUserfor consistency with other LaunchDarkly SDKs. Corresponding parameter names and documentation have also been updated to reflect this change. - Renamed
baseUriinLDConfig(formerlyLDClientConfig) topollUrito clarify that this URI is only used when polling. - The
fallbackparameter of allLDClientvariation methods has been renamed todefaultValueto help distinguish it fromfallbackvalues in rules specified in the LaunchDarkly dashboard. - Changed the default polling domain from
app.launchdarkly.comtoclientsdk.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
getConnectionInformationmethod inLDClienthad 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
identifyran on the current thread instead of on a background thread (thanks, orthanc and hackdie!) - Android: Fixed an issue where an exception was thrown if
configurewas invoked multiple times. Now, subsequent invocations result in a rejected promise. (#40) - Android: Fixed an issue where the
evaluationReasonsoption inLDClientConfigwas not used when configuring the Android SDK native module. - Android: Fixed an issue where
NullPointerExceptions 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
NullPointerExceptioncould 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
identifyto 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.privateAttributeNamesorLDClientConfig.allUserAttributesPrivateproperties. - 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
metricValueargument totrackto work with all numbers.
- Removed the
LDClientConfigtype. - Removed the
LDUserConfigtype. - Removed the
getConnectionInformationmethod inLDClient. - Removed the
isDisableBackgroundPollingmethod inLDClient. - Removed the
baseUriattribute inLDConfig(formerlyLDClientConfig).
- Changed iOS all flags listener to only return
[LDFlagKey]instead of[LDFlagKey: LDChangedFlag]. (#61)
isInitializedwas 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
trackmethod failed when called with a booleandatavalue 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
anonymoususer property has been changed tofalse. Previously this default was inconsistent; the default value wastruewhen running in iOS andfalsewhen running in Android. - Changed the default value for the
backgroundPollingIntervalMillisSDK 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
disableBackgroundUpdatingSDK configuration property has been changed tofalse. Previously this default was inconsistent; the default value wastruewhen running in iOS andfalsewhen running in Android.
- Fixed the
*VariationDetailmethods 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
evaluationReasonsconfiguration option. - Adds
user.countryuser 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
EvaluationDetailparsing from native to JS.
- Implemented
variationDetailwhich returns an Evaluation Reason giving developers greater insight into why a value was returned. - Added
allFlagsListenermethod, this returns flag keys whenever any flag key is updated. - Added
metricValueparameter totrackmethod. - 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
getConnectionInformationthat 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
registerCurrentConnectionModeListenerallows 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
userobject to theidentifymethod.
- 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.reactlibrarywhich 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
allFlagswill 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-clienttolaunchdarkly-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.podspecintoios/
- Changed
config.ymlto run againsthello-react-native.