@posthog/react-native-plugin 2.4.3 → 2.5.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.
@@ -86,5 +86,7 @@ dependencies {
86
86
  implementation "com.facebook.react:react-native:+"
87
87
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
88
88
  implementation "com.posthog:posthog-android:3.60.7"
89
+
90
+ testImplementation "junit:junit:4.13.2"
89
91
  }
90
92
 
@@ -158,6 +158,8 @@ class PosthogReactNativePluginModule(
158
158
  sessionReplayConfig.maskAllImages = maskAllImages
159
159
  sessionReplayConfig.maskAllTextInputs = maskAllTextInputs
160
160
  sessionReplayConfig.sampleRate = getDoubleOrNull(sdkReplayConfig, "sampleRate")
161
+ sessionReplayConfig.verifyScreenshotMaskAlignment =
162
+ getBoolean(sdkReplayConfig, "verifyScreenshotMaskAlignment", false)
161
163
 
162
164
  val endpoint = getString(decideReplayConfig, "endpoint", "")
163
165
  if (endpoint.isNotEmpty()) {
@@ -374,17 +376,6 @@ class PosthogReactNativePluginModule(
374
376
  }
375
377
  }.getOrNull()
376
378
 
377
- private fun hasKey(
378
- map: ReadableMap?,
379
- key: String,
380
- ): Boolean = runCatching { map != null && map.hasKey(key) && !map.isNull(key) }.getOrDefault(false)
381
-
382
- private fun getBoolean(
383
- map: ReadableMap?,
384
- key: String,
385
- default: Boolean,
386
- ): Boolean = runCatching { if (hasKey(map, key)) map?.getBoolean(key) ?: default else default }.getOrDefault(default)
387
-
388
379
  private fun getString(
389
380
  map: ReadableMap?,
390
381
  key: String,
@@ -634,3 +625,14 @@ class PosthogReactNativePluginModule(
634
625
  }
635
626
  }
636
627
  }
628
+
629
+ private fun hasKey(
630
+ map: ReadableMap?,
631
+ key: String,
632
+ ): Boolean = runCatching { map != null && map.hasKey(key) && !map.isNull(key) }.getOrDefault(false)
633
+
634
+ internal fun getBoolean(
635
+ map: ReadableMap?,
636
+ key: String,
637
+ default: Boolean,
638
+ ): Boolean = runCatching { if (hasKey(map, key)) map?.getBoolean(key) ?: default else default }.getOrDefault(default)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/react-native-plugin",
3
- "version": "2.4.3",
3
+ "version": "2.5.0",
4
4
  "description": "PostHog React Native plugin for iOS and Android integrations",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -32,6 +32,7 @@
32
32
  "!android/gradlew",
33
33
  "!android/gradlew.bat",
34
34
  "!android/local.properties",
35
+ "!android/src/test",
35
36
  "!**/__tests__",
36
37
  "!**/__fixtures__",
37
38
  "!**/__mocks__",