@posthog/react-native-plugin 2.2.0 → 2.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.
@@ -85,6 +85,6 @@ dependencies {
85
85
  //noinspection GradleDynamicVersion
86
86
  implementation "com.facebook.react:react-native:+"
87
87
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
88
- implementation "com.posthog:posthog-android:3.52.0"
88
+ implementation "com.posthog:posthog-android:3.53.6"
89
89
  }
90
90
 
@@ -7,9 +7,9 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule
7
7
  import com.facebook.react.bridge.ReactMethod
8
8
  import com.facebook.react.bridge.ReadableMap
9
9
  import com.facebook.react.bridge.UiThreadUtil
10
+ import com.facebook.react.common.JavascriptException
10
11
  import com.posthog.PostHog
11
12
  import com.posthog.PostHogConfig
12
- import com.posthog.PostHogEvent
13
13
  import com.posthog.android.PostHogAndroid
14
14
  import com.posthog.android.PostHogAndroidConfig
15
15
  import com.posthog.internal.PostHogPreferences
@@ -117,7 +117,7 @@ class PosthogReactNativePluginModule(
117
117
 
118
118
  // React Native rethrows fatal JS errors natively as JavascriptException.
119
119
  // The JS layer already captured them, so drop the native duplicate.
120
- addBeforeSend { event -> if (isReactNativeFatalJsError(event)) null else event }
120
+ errorTrackingConfig.ignoredExceptionTypes.add(JavascriptException::class.java)
121
121
 
122
122
  // Always apply the session replay configuration so that recording started later
123
123
  // (e.g. startRecording or a linked feature flag) uses the right mode and masking;
@@ -320,16 +320,6 @@ class PosthogReactNativePluginModule(
320
320
  key: String,
321
321
  ): Double? = runCatching { if (hasKey(map, key)) map?.getDouble(key) else null }.getOrNull()
322
322
 
323
- private fun isReactNativeFatalJsError(event: PostHogEvent): Boolean {
324
- if (event.event != "\$exception") return false
325
- val exceptionList = event.properties?.get("\$exception_list") as? List<*> ?: return false
326
- return exceptionList.any { item ->
327
- val exception = item as? Map<*, *> ?: return@any false
328
- exception["type"] == "JavascriptException" &&
329
- (exception["module"] as? String)?.startsWith("com.facebook.react") == true
330
- }
331
- }
332
-
333
323
  private fun logError(
334
324
  method: String,
335
325
  error: Throwable,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/react-native-plugin",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
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",
@@ -6,7 +6,7 @@ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1
6
6
  # Single source of truth for the posthog-ios native dependency version.
7
7
  # Used by both the SPM and CocoaPods resolution paths below; bump this
8
8
  # line when picking up a new posthog-ios release.
9
- posthog_ios_version = '3.63.0'
9
+ posthog_ios_version = '3.64.7'
10
10
 
11
11
  Pod::Spec.new do |s|
12
12
  s.name = "posthog-react-native-plugin"