@logrocket/react-native 0.23.2 → 0.27.0

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/README.md CHANGED
@@ -42,7 +42,7 @@ Now you can build your app with [EAS Build](https://docs.expo.io/build/introduct
42
42
  | Exceptions | :heavy_check_mark: | :heavy_check_mark: |
43
43
  | Custom Events | :heavy_check_mark: | :heavy_check_mark: |
44
44
  | getSessionURL | :heavy_check_mark: | :heavy_check_mark: |
45
- | [Redux middleware][redux-middleware] | :heavy_check_mark: | :x: |
45
+ | [Redux middleware][redux-middleware] | :heavy_check_mark: | :heavy_check_mark: |
46
46
  | Connection quality config | :heavy_check_mark: | :x: |
47
47
 
48
48
  LogRocket instruments the XmlHttpRequest and fetch APIs to capture network requests and responses.
@@ -14,7 +14,7 @@ def DEFAULT_COMPILE_SDK_VERSION = 28
14
14
  def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3'
15
15
  def DEFAULT_MIN_SDK_VERSION = 21
16
16
  def DEFAULT_TARGET_SDK_VERSION = 28
17
- def SDK_VERSION = "0.23.2"
17
+ def SDK_VERSION = "0.27.0"
18
18
 
19
19
  def PACKAGE_ROOT_DIR = rootProject.name == 'LogRocket SDK' ? "$rootDir/../packages/@logrocket/react-native" : "$rootDir/..";
20
20
 
@@ -23,7 +23,7 @@ def safeExtGet(prop, fallback) {
23
23
  }
24
24
 
25
25
  apply plugin: 'com.android.library'
26
- apply plugin: 'maven'
26
+ apply plugin: 'maven-publish'
27
27
 
28
28
  buildscript {
29
29
  // The Android Gradle plugin is only required when opening the android folder stand-alone.
@@ -42,7 +42,7 @@ buildscript {
42
42
  }
43
43
 
44
44
  apply plugin: 'com.android.library'
45
- apply plugin: 'maven'
45
+ apply plugin: 'maven-publish'
46
46
 
47
47
  android {
48
48
  compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
@@ -55,6 +55,23 @@ public class LogRocketNativeModule extends ReactContextBaseJavaModule {
55
55
  this.reactContext.registerReceiver(receiver, filter);
56
56
  }
57
57
 
58
+ private static Map<String, String> formatReadableMap(ReadableMap map) {
59
+ Map<String, String> formattedMap = new HashMap<>();
60
+
61
+ if (map == null) {
62
+ return formattedMap;
63
+ }
64
+
65
+ Iterator<Map.Entry<String, Object>> iterator = map.getEntryIterator();
66
+
67
+ while (iterator.hasNext()) {
68
+ Map.Entry<String, Object> entry = iterator.next();
69
+ formattedMap.put(entry.getKey(), entry.getValue().toString());
70
+ }
71
+
72
+ return formattedMap;
73
+ }
74
+
58
75
  @NonNull
59
76
  @Override
60
77
  public String getName() {
@@ -294,32 +311,32 @@ public class LogRocketNativeModule extends ReactContextBaseJavaModule {
294
311
  if (protobufVariant.hasKey("doubleVal")) {
295
312
  ReadableArray readableArray = protobufVariant.getArray("doubleVal");
296
313
  if (readableArray != null) {
297
- Iterator<Object> arrayIterator = readableArray.toArrayList().iterator();
298
- ArrayList<Double> list = new ArrayList<>();
299
- while (arrayIterator.hasNext()) {
300
- list.add((Double) arrayIterator.next());
314
+ Double[] list = new Double[readableArray.size()];
315
+ for (int i = 0; i < readableArray.size(); i++) {
316
+ list[i] = readableArray.getDouble(i);
301
317
  }
302
- builder.putDoubleArray(keyString, list);
318
+
319
+ builder.put(keyString, list);
303
320
  }
304
321
  } else if (protobufVariant.hasKey("boolVal")) {
305
322
  ReadableArray readableArray = protobufVariant.getArray("boolVal");
306
323
  if (readableArray != null) {
307
- Iterator<Object> arrayIterator = readableArray.toArrayList().iterator();
308
- ArrayList<Boolean> list = new ArrayList<>();
309
- while (arrayIterator.hasNext()) {
310
- list.add((Boolean) arrayIterator.next());
324
+ Boolean[] list = new Boolean[readableArray.size()];
325
+ for (int i = 0; i < readableArray.size(); i++) {
326
+ list[i] = readableArray.getBoolean(i);
311
327
  }
312
- builder.putBooleanArray(keyString, list);
328
+
329
+ builder.put(keyString, list);
313
330
  }
314
331
  } else if (protobufVariant.hasKey("stringVal")) {
315
332
  ReadableArray readableArray = protobufVariant.getArray("stringVal");
316
333
  if (readableArray != null) {
317
- Iterator<Object> arrayIterator = readableArray.toArrayList().iterator();
318
- ArrayList<String> list = new ArrayList<>();
319
- while (arrayIterator.hasNext()) {
320
- list.add((String) arrayIterator.next());
334
+ String[] list = new String[readableArray.size()];
335
+ for (int i = 0; i < readableArray.size(); i++) {
336
+ list[i] = readableArray.getString(i);
321
337
  }
322
- builder.putStringArray(keyString, list);
338
+
339
+ builder.put(keyString, list);
323
340
  }
324
341
  }
325
342
  }
@@ -394,23 +411,6 @@ public class LogRocketNativeModule extends ReactContextBaseJavaModule {
394
411
  }
395
412
  }
396
413
 
397
- private static Map<String, String> formatReadableMap(ReadableMap map) {
398
- Map<String, String> formattedMap = new HashMap<>();
399
-
400
- if (map == null) {
401
- return formattedMap;
402
- }
403
-
404
- Iterator<Map.Entry<String, Object>> iterator = map.getEntryIterator();
405
-
406
- while (iterator.hasNext()) {
407
- Map.Entry<String, Object> entry = iterator.next();
408
- formattedMap.put(entry.getKey(), entry.getValue().toString());
409
- }
410
-
411
- return formattedMap;
412
- }
413
-
414
414
  class LogRocketReceiver extends BroadcastReceiver {
415
415
  private final ReactApplicationContext reactContext;
416
416
  private final Logger logger = new TaggedLogger("logrocket-receiver");