Skip to content

@posthog/react-native-plugin@3.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 01 Dec 18:49
Immutable release. Only release title and notes can be modified.
6ce97f6

3.0.0

Major Changes

  • #5194 c4fb72a Thanks @turnipdabeets! - Release @posthog/react-native-plugin 3.0. See the migration guide for upgrade steps
    • Breaking: require React Native 0.75 or later
    • Breaking: require iOS 15 or later and macOS 12 or later
    • Breaking: require posthog-ios 4.2.2 or a later 4.2.x version, which needs Xcode 26
    • Breaking: require posthog-android 4.2.3 or a later 4.2.x version
    • Fail the Android build instead of crashing at runtime when another dependency would raise posthog-android past 4.2.x
    • Breaking: resolve posthog-ios through Swift Package Manager instead of CocoaPods trunk and ignore the posthog.useSpm Podfile property
    • Breaking: fail pod install for Podfiles that also include posthog-react-native-session-replay or the PostHog pod — remove them
    • Breaking: fail pod install for Podfiles that use generate_multiple_pod_projects, deduplicate_targets => false, or plugin targets with different platforms or use_frameworks! linkage
    • Breaking: require posthog-react-native 4.88.4 or later, and read the project token in setup() only from projectToken, not the deprecated apiKey. With an older posthog-react-native, native PostHog stays off and the plugin logs an error
    • Breaking: remove the legacy start() method — call setup() instead
    • Breaking: ignore iOSdebouncerDelayMs and androidDebouncerDelayMs when calling setup() directly — pass throttleDelayMs instead
    • Breaking: send native iOS and Android events (crash reports, fatal JavaScript errors, iOS rage clicks, push notification opens) to capture v1 (/i/v1/analytics/events) with Authorization: Bearer <projectToken>, replacing any Authorization from requestHeaders — serve this path on reverse proxies and self-hosted instances
    • Breaking: drop native events when a proxy redirects them, other than with a 307 or 308 to the same origin as host
    • Breaking: drop native events whose distinct ID is empty, whitespace-only or over 200 bytes, instead of shortening the ID
    • Breaking: omit null property values from native iOS events and keep null list elements in native Android events
    • Breaking: report $locale on native events as the device's preferred language, as a full language tag with region, such as de-CH instead of de, and as he, id and yi instead of the legacy iw, in and ji on Android. On iOS, an English-only app on a French device sends fr-FR instead of en
    • Breaking: ignore screenshotModeBackgroundCapture on iOS, because posthog-ios 4.0 removed background screenshot capture. Remove it, or set iOSCaptureMethod: 'gpu'
    • Always record session replay as masked screenshots on iOS and Android, the mode the plugin already used
    • Apply the project's mobile session replay masking setting on iOS and Android, which can add text and image masking but never remove it
    • Add PosthogReactNativePlugin.addBeforeSend in Swift and Kotlin to filter or edit events the native SDKs send, such as crash reports from the previous launch, which the JS before_send never sees
    • Load the native module as a TurboModule on React Native's New Architecture, and keep loading it as a bridge module on the old architecture
    • Add iOSCaptureMethod ('standard' or experimental 'gpu') to choose how iOS captures replay screenshots, set through posthog-react-native's sessionReplayConfig (4.89.0+)
    • Add setSessionReplayMinimumDuration
    • Send the language set with posthog-react-native's setAppLanguage() (4.86.0+) as $app_language on native events
    • Gzip posthog-react-native's (5.0+) analytics, AI and log requests natively on iOS and Android, off the JS thread
    • Wait on iOS for a fatal JS exception's request before React Native aborts the app, so the next launch doesn't send the exception again
    • Leave $is_identified off an iOS fatal JS exception when posthog-react-native sends it as null, as on Android, instead of sending null
    • Pause iOS native uploads (session replay, native crash reports) while the device is on cellular and cellular data is turned off for the app, instead of sending requests that fail
    • Wait at most 30 seconds on Retry-After for session replay and native uploads, and double the wait after each failed upload up to 30 seconds
    • Drop native crashes recorded while the user was opted out instead of sending them after optIn()
    • Mark iOS native crash frames from dynamic frameworks, such as Hermes, as not in-app, so some native crash issues may be grouped again once
    • Keep iOS secure text inputs masked inside ph-no-mask views, and stop recording touches inside ph-no-capture views on Android, as on iOS since 2.13.2
    • Stop bundling posthog-ios's native surveys in apps that use React Native's Swift Package Manager integration (2026-12-01)