@coralogix/react-native-plugin 0.1.0 → 0.1.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 CHANGED
@@ -1,3 +1,14 @@
1
+ ## 0.1.2 (2025-09-01)
2
+
3
+ ### Patch
4
+ Bump ios native version to 1.2.3
5
+
6
+ ## 0.1.1 (2025-09-01)
7
+
8
+ ### 🩹 Fixes
9
+
10
+ - better support for react native v0.78.2 and above
11
+
1
12
  ## 0.1.0 (2025-08-27)
2
13
 
3
14
  ### 🚀 Features
package/CxSdk.podspec CHANGED
@@ -16,8 +16,8 @@ Pod::Spec.new do |s|
16
16
 
17
17
  s.source_files = "ios/**/*.{h,m,mm,swift}"
18
18
 
19
- s.dependency 'Coralogix','1.2.2'
20
- s.dependency 'CoralogixInternal','1.2.2'
19
+ s.dependency 'Coralogix','1.2.3'
20
+ s.dependency 'CoralogixInternal','1.2.3'
21
21
 
22
22
 
23
23
  # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
package/README.md CHANGED
@@ -176,6 +176,20 @@ CoralogixRum.init({
176
176
  });
177
177
  ```
178
178
 
179
+ ### Android integration
180
+ Our Android native SDK uses java 8 features that requires desugaring to be enabled, on your native android project add this to your app module build.gradle:
181
+ ```groovy
182
+ android {
183
+ compileOptions {
184
+ coreLibraryDesugaringEnabled true
185
+ }
186
+ }
187
+
188
+ dependencies {
189
+ coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.1.5"
190
+ }
191
+ ```
192
+
179
193
  ### Troubleshooting
180
194
 
181
195
  #### URL.origin is not implemented
@@ -183,5 +197,4 @@ CoralogixRum.init({
183
197
  1. `npm install react-native-url-polyfill`
184
198
  2. At the top of your entry-point file (index.js) add:
185
199
  `import "react-native-url-polyfill/auto"`
186
-
187
200
  ---
@@ -286,7 +286,9 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
286
286
  return list
287
287
  }
288
288
 
289
- private fun convertReadableArrayToAnyList(readableArray: ReadableArray): List<Any?> {
289
+ private fun convertReadableArrayToAnyList(readableArray: ReadableArray?): List<Any?> {
290
+ if (readableArray == null) return emptyList()
291
+
290
292
  val list = mutableListOf<Any?>()
291
293
  for (i in 0 until readableArray.size()) {
292
294
  when (readableArray.getType(i)) {
@@ -304,7 +306,9 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
304
306
  return list
305
307
  }
306
308
 
307
- private fun convertReadableMapToMap(readableMap: ReadableMap): Map<String, Any?> {
309
+ private fun convertReadableMapToMap(readableMap: ReadableMap?): Map<String, Any?> {
310
+ if (readableMap == null) return emptyMap()
311
+
308
312
  val map = mutableMapOf<String, Any?>()
309
313
  val iterator = readableMap.keySetIterator()
310
314
  while (iterator.hasNextKey()) {
@@ -345,11 +349,11 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
345
349
  for (i in 0 until size()) {
346
350
  when (getType(i)) {
347
351
  ReadableType.String -> {
348
- result.add(getString(i))
352
+ getString(i)?.let { result.add(it) }
349
353
  }
350
354
  ReadableType.Map -> {
351
355
  val map = getMap(i)
352
- val pattern = map.getString("source") // Extract regex pattern
356
+ val pattern = map?.getString("source") // Extract regex pattern
353
357
  pattern?.let { result.add(it) }
354
358
  }
355
359
  else -> {
@@ -439,13 +443,14 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
439
443
  val out = ArrayList<HybridMetric>(size())
440
444
  for (i in 0 until size()) {
441
445
  val m = getMap(i)
442
- val name = m.getString("name") ?: throw IllegalArgumentException("metrics[$i].name is required")
446
+ val name = m?.getString("name") ?: throw IllegalArgumentException("metrics[$i].name is required")
443
447
  // RN numbers are Double; accept both Int and Double transparently:
444
448
  val value = when {
445
- m.hasKey("value") && !m.isNull("value") -> m.getDouble("value")
449
+ m?.hasKey("value") == true && m?.isNull("value") == false -> m?.getDouble("value")
450
+ ?: throw IllegalArgumentException("metrics[$i].value is required")
446
451
  else -> throw IllegalArgumentException("metrics[$i].value is required")
447
452
  }
448
- val units = m.getString("units") ?: throw IllegalArgumentException("metrics[$i].units is required")
453
+ val units = m?.getString("units") ?: throw IllegalArgumentException("metrics[$i].units is required")
449
454
  out += HybridMetric(name = name, value = value, units = units)
450
455
  }
451
456
  return out
package/index.cjs.js CHANGED
@@ -219,7 +219,7 @@ function stopJsRefreshRateSampler() {
219
219
  appStateSub = null;
220
220
  }
221
221
 
222
- var version = "0.1.0";
222
+ var version = "0.1.2";
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.1.0";
220
+ var version = "0.1.2";
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.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Official Coralogix React Native plugin",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Coralogix",