Skip to content

Commit 0f1ac39

Browse files
Get remote config value for key fix (#239)
* Fixed bug in Android where getRemoteConfigValueForKey method returned RCData * Versioning * Update CountlyReactNative.java * Update CountlyReactNative.java * Update CHANGELOG.md --------- Co-authored-by: Artūrs Kadiķis <[email protected]>
1 parent d22603e commit 0f1ac39

File tree

6 files changed

+25
-19
lines changed

6 files changed

+25
-19
lines changed

CHANGELOG.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 23.6.1
2+
* Fixed bug for Android devices where "getRemoteConfigValueForKey" and "getRemoteConfigValueForKeyP" methods would return the RCData object.
3+
4+
* Underlying Android SDK version is 23.8.2
5+
* Underlying iOS SDK version is 23.8.2
6+
17
## 23.6.0
28
* !! Major breaking change !! 'start' and 'stop' calls have been deprecated. They will do nothing. The SDK will now automatically track sessions based on the app's time in the foreground.
39
* ! Minor breaking change ! Remote config will now return previously downloaded values when remote-config consent is not given
@@ -22,20 +28,20 @@
2228
* Added 'setPushTokenType' and 'setPushNotificationChannel' calls to replace deprecated calls to the Countly Config Object.
2329
* Deprecated the following SDK call: 'CountlyConfig.pushTokenType'
2430

25-
* Underlying Android SDK version to 22.09.4
26-
* Underlying iOS SDK version to 23.02.2
31+
* Underlying Android SDK version is 22.09.4
32+
* Underlying iOS SDK version is 23.02.2
2733

2834
## 23.2.3
2935
* Fixed bug where the push notification type was not correctly set during init
3036

31-
* Underlying Android SDK version to 22.09.4
32-
* Underlying iOS SDK version to 23.02.2
37+
* Underlying Android SDK version is 22.09.4
38+
* Underlying iOS SDK version is 23.02.2
3339

3440
## 23.2.2
3541
* Fixed bug that caused an issue in the deprecated init call
3642

37-
* Underlying Android SDK version to 22.09.4
38-
* Underlying iOS SDK version to 23.02.2
43+
* Underlying Android SDK version is 22.09.4
44+
* Underlying iOS SDK version is 23.02.2
3945

4046
## 23.2.1
4147
* Default max segmentation value count changed from 30 to 100

CountlyReactNative.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'CountlyReactNative'
3-
s.version = '23.6.0'
3+
s.version = '23.6.1'
44
s.license = {
55
:type => 'COMMUNITY',
66
:text => <<-LICENSE

android/src/main/java/ly/count/android/sdk/react/CountlyReactNative.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public String toString() {
8787
public class CountlyReactNative extends ReactContextBaseJavaModule implements LifecycleEventListener {
8888

8989
public static final String TAG = "CountlyRNPlugin";
90-
private String COUNTLY_RN_SDK_VERSION_STRING = "23.6.0";
90+
private String COUNTLY_RN_SDK_VERSION_STRING = "23.6.1";
9191
private String COUNTLY_RN_SDK_NAME = "js-rnb-android";
9292

9393
private static final CountlyConfig config = new CountlyConfig();
@@ -377,7 +377,7 @@ public void getCurrentDeviceId(Promise promise) {
377377
}
378378

379379
@ReactMethod
380-
public void getDeviceIDType(Promise promise){
380+
public void getDeviceIDType(Promise promise) {
381381
DeviceIdType deviceIDType = Countly.sharedInstance().deviceId().getType();
382382
String deviceIDTypeString = null;
383383
switch (deviceIDType) {
@@ -1146,25 +1146,25 @@ public void updateRemoteConfigExceptKeys(ReadableArray args, final Callback myCa
11461146
@ReactMethod
11471147
public void getRemoteConfigValueForKey(ReadableArray args, final Callback myCallback) {
11481148
String keyName = args.getString(0);
1149-
Object keyValue = Countly.sharedInstance().remoteConfig().getValue(keyName);
1150-
if (keyValue == null) {
1149+
RCData keyValue = Countly.sharedInstance().remoteConfig().getValue(keyName);
1150+
if (keyValue.value == null) {
11511151
log("getRemoteConfigValueForKey, [" + keyName + "]: ConfigKeyNotFound", LogLevel.DEBUG);
11521152
myCallback.invoke("ConfigKeyNotFound");
11531153
} else {
1154-
String resultString = (keyValue).toString();
1154+
String resultString = (keyValue.value).toString();
11551155
log("getRemoteConfigValueForKey, [" + keyName + "]: " + resultString, LogLevel.DEBUG);
11561156
myCallback.invoke(resultString);
11571157
}
11581158
}
11591159

11601160
@ReactMethod
11611161
public void getRemoteConfigValueForKeyP(String keyName, Promise promise) {
1162-
Object keyValue = Countly.sharedInstance().remoteConfig().getValue(keyName);
1163-
if (keyValue == null) {
1162+
RCData keyValue = Countly.sharedInstance().remoteConfig().getValue(keyName);
1163+
if (keyValue.value == null) {
11641164
log("getRemoteConfigValueForKeyP, [" + keyName + "]: ConfigKeyNotFound", LogLevel.DEBUG);
11651165
promise.reject("ConfigKeyNotFound", null, null, null);
11661166
} else {
1167-
String resultString = (keyValue).toString();
1167+
String resultString = (keyValue.value).toString();
11681168
log("getRemoteConfigValueForKeyP, [" + keyName + "]: " + resultString, LogLevel.DEBUG);
11691169
promise.resolve(resultString);
11701170
}
@@ -1472,7 +1472,7 @@ public void onHostResume() {
14721472

14731473
@Override
14741474
public void onHostPause() {
1475-
1475+
14761476
}
14771477

14781478
@Override

example/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ rm App.js
1111
curl https://raw.githubusercontent.com/Countly/countly-sdk-react-native-bridge/master/example/App.js --output App.js
1212
curl https://raw.githubusercontent.com/Countly/countly-sdk-react-native-bridge/master/example/Example.js --output Example.js
1313

14-
14+
1515

1616
cd ./ios
1717
pod install

ios/src/CountlyReactNative.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ @interface CountlyFeedbackWidget ()
2424
+ (CountlyFeedbackWidget *)createWithDictionary:(NSDictionary *)dictionary;
2525
@end
2626

27-
NSString *const kCountlyReactNativeSDKVersion = @"23.6.0";
27+
NSString *const kCountlyReactNativeSDKVersion = @"23.6.1";
2828
NSString *const kCountlyReactNativeSDKName = @"js-rnb-ios";
2929

3030
CLYPushTestMode const CLYPushTestModeProduction = @"CLYPushTestModeProduction";

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "countly-sdk-react-native-bridge",
3-
"version": "23.6.0",
3+
"version": "23.6.1",
44
"author": "Countly <[email protected]> (https://count.ly/)",
55
"bugs": {
66
"url": "https://github.com/Countly/countly-sdk-react-native-bridge/issues"

0 commit comments

Comments
 (0)