@coralogix/react-native-plugin 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 0.2.1 (2025-11-18)
2
+
3
+ ### 🚀 Features
4
+
5
+ - update git ignore ([#72](https://github.com/coralogix/cx-react-native-plugin/pull/72))
6
+
7
+ ### 🩹 Patch
8
+
9
+ - Bump Android native version to 2.6.0, updated the code to support latest changes in the native sdk
10
+
1
11
  ## 0.2.0 (2025-11-11)
2
12
 
3
13
  ### 🚀 Features
@@ -75,7 +75,7 @@ dependencies {
75
75
  implementation "com.facebook.react:react-android"
76
76
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
77
77
 
78
- implementation "com.coralogix:android-sdk:2.5.7"
78
+ implementation "com.coralogix:android-sdk:2.6.0"
79
79
  }
80
80
 
81
81
  react {
@@ -93,13 +93,14 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
93
93
 
94
94
  @ReactMethod
95
95
  override fun setLabels(labelsMap: ReadableMap) {
96
- val labels = labelsMap.toStringMap()
96
+ val labels = labelsMap.toStringAnyMap()
97
97
  CoralogixRum.setLabels(labels)
98
98
  }
99
99
 
100
100
  @ReactMethod
101
101
  override fun getLabels(promise: Promise) {
102
- promise.resolve(CoralogixRum.getLabels().toWritableMap())
102
+ val labelsMap = convertMapToWritableMap(CoralogixRum.getLabels())
103
+ promise.resolve(labelsMap)
103
104
  }
104
105
 
105
106
  @ReactMethod
@@ -109,7 +110,7 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
109
110
 
110
111
  @ReactMethod
111
112
  override fun log(severity: Int, message: String, data: ReadableMap, labels: ReadableMap) {
112
- CoralogixRum.log(severity.toCoralogixLogSeverity(), message, data.toStringMap(), labels.toStringMap())
113
+ CoralogixRum.log(severity.toCoralogixLogSeverity(), message, data.toStringAnyMap(), labels.toStringAnyMap())
113
114
  }
114
115
 
115
116
  @ReactMethod
@@ -316,7 +317,7 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
316
317
  applicationName = applicationName,
317
318
  coralogixDomain = coralogixDomain,
318
319
  publicKey = publicKey,
319
- labels = getMap("labels")?.toStringMap() ?: mapOf(),
320
+ labels = getMap("labels")?.toStringAnyMap() ?: mapOf(),
320
321
  environment = getString("environment") ?: "",
321
322
  version = getString("version") ?: "",
322
323
  userContext = getMap("user_context")?.toUserContext() ?: UserContext(),
@@ -517,6 +518,27 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
517
518
  )
518
519
  }
519
520
 
521
+ private fun ReadableMap.toStringAnyMap(): Map<String, Any?> {
522
+ val result = mutableMapOf<String, Any?>()
523
+ val iterator = keySetIterator()
524
+ while (iterator.hasNextKey()) {
525
+ val key = iterator.nextKey()
526
+ val jsonValue = when (getType(key)) {
527
+ ReadableType.Null -> JSONObject.NULL
528
+ ReadableType.Boolean -> getBoolean(key)
529
+ ReadableType.Number -> getDouble(key)
530
+ ReadableType.String -> getString(key)
531
+ ReadableType.Map -> getMap(key)?.toStringAnyMap()
532
+ ReadableType.Array -> convertReadableArrayToAnyList(getArray(key))
533
+ else -> JSONObject.NULL
534
+ }
535
+
536
+ result[key] = jsonValue
537
+ }
538
+
539
+ return result
540
+ }
541
+
520
542
  private fun ReadableMap.toStringMap(): Map<String, String> {
521
543
  val result = mutableMapOf<String, String>()
522
544
  val iterator = keySetIterator()
package/index.cjs.js CHANGED
@@ -219,7 +219,7 @@ function stopJsRefreshRateSampler() {
219
219
  appStateSub = null;
220
220
  }
221
221
 
222
- var version = "0.2.0";
222
+ var version = "0.2.1";
223
223
  var pkg = {
224
224
  version: version};
225
225
 
package/index.esm.js CHANGED
@@ -217,7 +217,7 @@ function stopJsRefreshRateSampler() {
217
217
  appStateSub = null;
218
218
  }
219
219
 
220
- var version = "0.2.0";
220
+ var version = "0.2.1";
221
221
  var pkg = {
222
222
  version: version};
223
223
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coralogix/react-native-plugin",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Official Coralogix React Native plugin",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Coralogix",