Sessions & Push Opens
Measure session length and per-notification open rates with the native-notify analytics flags.
Two more analytic signals ship in the same wave — both opt-in, both needing no extra code beyond their flag.
Sessions
Enable with analytics: { sessions: true }.
registerNNPushToken wires session tracking automatically: a session starts when the app becomes active and ends when it backgrounds, and the SDK reports the duration. The dashboard shows sessions per day and average session length, plus a growth delta against the previous period.
Details:
- If your app restarts a session after coming back from the background, that's a new session — standard mobile analytics behavior.
- Durations are clamped to 24 hours, and each session is reported once (retries are deduplicated server-side by session id).
- Session reporting is best-effort and skips gracefully in environments without
AppState(like web).
If you don't use registerNNPushToken for registration, wire it manually:
import { useNativeNotifySessionTracking } from "native-notify";
export default function App() {
useNativeNotifySessionTracking();
// ...
}
Push opens
Enable with analytics: { opens: true }.
When a user taps one of your push notifications, the SDK reports it and the dashboard attributes the open to that notification. You will see:
- Delivered vs. opened (total taps) and unique opens per notification, plus an open-rate trend over the most recent 50 sends.
- Best send times: a weekday × hour heatmap (UTC) of when opens actually happen, so you can schedule announcements shortly before your busiest hours.
How it works, and the limits worth knowing:
- Native Notify includes a
nn_notification_id(andnn_source) inside the push payload of every mass and single indie send — on every transport (Expo, FCM v1, APNs). Your ownpushDatakeys are untouched. - The SDK reads that id on tap — including the tap that launches a cold app — and reports it. One tap counts once, even though two internal listeners can see it.
- Taps on notifications sent before you enabled this flag (or before the analytics ship) have no id and are skipped; group/topic sends are not per-notification attributable and are skipped too.
- "Opened" is a client-reported signal and inherently best-effort: it counts at the moment of the tap, only for apps running the SDK with the flag on. Delivered counts come from Expo's delivery receipts and are the authoritative side of the rate.
Where it shows up
| Dashboard card | Uses |
|---|---|
| Growth & Engagement | Sessions, average session length |
| Push Notification Delivery & Opens | Delivered / opened / unique opens / open rate per notification, trend chart |
| Best Send Times | Open events by weekday × hour (UTC) |
| Send Failures | Expo receipt error codes (no SDK flag needed) |