@coralogix/react-native-plugin 0.2.0 → 0.2.2
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 +16 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/cxsdk/CxSdkModule.kt +26 -4
- package/index.cjs.js +1 -1
- package/index.esm.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 0.2.2 (2025-11-20)
|
|
2
|
+
|
|
3
|
+
### 🩹 Patch
|
|
4
|
+
|
|
5
|
+
- chore: updated the android native sdk to version 2.6.1
|
|
6
|
+
|
|
7
|
+
## 0.2.1 (2025-11-18)
|
|
8
|
+
|
|
9
|
+
### 🚀 Features
|
|
10
|
+
|
|
11
|
+
- update git ignore ([#72](https://github.com/coralogix/cx-react-native-plugin/pull/72))
|
|
12
|
+
|
|
13
|
+
### 🩹 Patch
|
|
14
|
+
|
|
15
|
+
- Bump Android native version to 2.6.0, updated the code to support latest changes in the native sdk
|
|
16
|
+
|
|
1
17
|
## 0.2.0 (2025-11-11)
|
|
2
18
|
|
|
3
19
|
### 🚀 Features
|
package/android/build.gradle
CHANGED
|
@@ -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.
|
|
78
|
+
implementation "com.coralogix:android-sdk:2.6.1"
|
|
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.
|
|
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
|
-
|
|
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.
|
|
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")?.
|
|
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
package/index.esm.js
CHANGED