Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Commit 743f10c

Browse files
committed
Merge branch 'next-release'
2 parents f2a9bc6 + 3685df5 commit 743f10c

File tree

6 files changed

+29
-7
lines changed

6 files changed

+29
-7
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- run: mkdir -p ~/.gradle && echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
1818
- run: sdkmanager "system-images;android-24;default;armeabi-v7a"
1919
- run: sdkmanager --licenses
20-
- run: sudo apt-get install libpulse0
20+
- run: sudo apt-get update && sudo apt-get install libpulse0
2121
- run: echo no | avdmanager create avd -n rn-android -f -k "system-images;android-24;default;armeabi-v7a"
2222
- run:
2323
command: emulator -avd rn-android -netdelay none -netspeed full -no-audio -no-window -no-snapshot -use-system-libs -no-boot-anim

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
All notable changes to the LaunchDarkly React Native SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
44

5+
## [2.0.1] - 2019-06-27
6+
### Fixed
7+
- Listeners on Android now have the proper event emitter key and work properly.
8+
- Flag values in the object returned by `allFlags` will no longer be Strings when they should be JSON Objects on Android.
9+
10+
### Changed
11+
- Updated Android Client SDK to version 2.8.5
12+
- Updated iOS Client SDK to version 4.1.2
13+
514
## [2.0.0] - 2019-06-27
615
### Fixed
716
- Changes polling mode to not be ignored in config.

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ allprojects {
4848

4949
dependencies {
5050
implementation 'com.facebook.react:react-native:+'
51-
implementation 'com.launchdarkly:launchdarkly-android-client-sdk:2.8.4'
51+
implementation 'com.launchdarkly:launchdarkly-android-client-sdk:2.8.5'
5252
implementation 'com.jakewharton.timber:timber:4.7.1'
5353
implementation "com.google.code.gson:gson:2.8.5"
5454
}

android/src/main/java/com/reactlibrary/LaunchdarklyReactNativeClientModule.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import com.google.gson.JsonNull;
2323
import com.google.gson.JsonObject;
2424
import com.google.gson.JsonPrimitive;
25+
import com.google.gson.JsonParser;
26+
import com.google.gson.JsonParseException;
2527
import com.launchdarkly.android.FeatureFlagChangeListener;
2628
import com.launchdarkly.android.LDClient;
2729
import com.launchdarkly.android.LDConfig;
@@ -601,7 +603,18 @@ public void allFlags(Promise promise) {
601603
if (entry.getValue() == null) {
602604
response.putNull(entry.getKey());
603605
} else if (entry.getValue() instanceof String) {
604-
response.putString(entry.getKey(), (String) entry.getValue());
606+
try {
607+
JsonElement parsedJson = new JsonParser().parse((String) entry.getValue());
608+
if (parsedJson.isJsonObject()) {
609+
response.putMap(entry.getKey(), fromJsonObject((JsonObject) parsedJson.getAsJsonObject()));
610+
} else if (parsedJson.isJsonArray()) {
611+
response.putArray(entry.getKey(), fromJsonArray((JsonArray) parsedJson.getAsJsonArray()));
612+
} else {
613+
response.putString(entry.getKey(),(String) entry.getValue());
614+
}
615+
} catch (JsonParseException e) {
616+
response.putString(entry.getKey(),(String) entry.getValue());
617+
}
605618
} else if (entry.getValue() instanceof Boolean) {
606619
response.putBoolean(entry.getKey(), (Boolean) entry.getValue());
607620
} else if (entry.getValue() instanceof Double) {
@@ -825,7 +838,7 @@ public void onFeatureFlagChange(String flagKey) {
825838

826839
getReactApplicationContext()
827840
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
828-
.emit(EVENT_PREFIX.concat(flagKey), result);
841+
.emit(EVENT_PREFIX, result);
829842
}
830843
};
831844

ios/LaunchdarklyReactNativeClient.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Pod::Spec.new do |s|
33
s.name = "LaunchdarklyReactNativeClient"
4-
s.version = "2.0.0"
4+
s.version = "2.0.1"
55
s.summary = "LaunchdarklyReactNativeClient"
66
s.description = <<-DESC
77
LaunchdarklyReactNativeClient
@@ -16,6 +16,6 @@ Pod::Spec.new do |s|
1616
s.swift_version = "5.0"
1717

1818
s.dependency "React"
19-
s.dependency "LaunchDarkly", "4.1.0"
19+
s.dependency "LaunchDarkly", "4.1.2"
2020

2121
end

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "launchdarkly-react-native-client-sdk",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)