From 694ea2f186032e91c7b968eeee47bbb0bb04653c Mon Sep 17 00:00:00 2001 From: Anna Garcia Date: Fri, 11 Sep 2026 09:25:04 -0400 Subject: [PATCH] docs(push): rewrite React Native manual open capture guidance Release-dependent half of the push open docs update. The corrections that are true today moved to #20114. --- .../push-notifications/react-native.mdx | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/contents/docs/workflows/push-notifications/react-native.mdx b/contents/docs/workflows/push-notifications/react-native.mdx index 0074f6ec31fa..9c307414eee8 100644 --- a/contents/docs/workflows/push-notifications/react-native.mdx +++ b/contents/docs/workflows/push-notifications/react-native.mdx @@ -70,24 +70,17 @@ Registration and unregistration are durable. If the device is offline or the req ## Capturing opens -For the opens automatic capture misses (locally-scheduled notifications on either platform, plus warm-start taps and foreground messages on Android), call the manual API: +Taps on remote notifications are captured for you (see above). Automatic capture can't see locally-scheduled notifications, notifications you display yourself from a foreground message, or push delivered outside FCM on Android. Call the manual API only for those: ```react-native -import messaging from '@react-native-firebase/messaging' -import { Platform } from 'react-native' - -if (Platform.OS === 'android') { - messaging().onNotificationOpenedApp((message) => { - posthog.capturePushNotificationOpened({ - title: message.notification?.title, - body: message.notification?.body, - payload: message.data, - }) - }) -} +posthog.capturePushNotificationOpened({ + title: 'Your order shipped', + body: 'Track it in the app', + payload: { order_id: '1234' }, +}) ``` -Only call it for opens automatic capture can't see itself, or the tap is counted twice. +Don't wire this to `messaging().onNotificationOpenedApp` or `getInitialNotification()`. The SDK already captures those taps, and the manual call isn't deduplicated against them, so the open is counted twice. If you added an `onNotificationOpenedApp` handler for Android on an earlier plugin version, remove it when you upgrade to 2.6.0. The `$push_notification_opened` event includes `$notification_title` and `$notification_body` (plus `$notification_subtitle` on iOS), and `$notification_action` for action-button taps. Notification content is only captured for notifications sent by PostHog. Opens of other notifications are still captured, but without title or body.