Skip to content
Back to skills

Rn Push Notifications

ASecurity

Use when adding push or local notifications to an Expo + RN app: requesting permissions at the right moment, registering for push (Expo push service in dev, APNs/FCM direct in prod), handling foreground + tapped + cold-start notifications, deep linking from a notification payload to a specific route, scheduling local notifications, badge management. Triggers on: "add push notifications", "local notification", "deep link from notification", "iOS/Android push setup", "register for notifications...

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 19, 2026
developmentgoreactapibackend

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned October 19, 2026

npx -y skills add lukedj78/dev-flow --skill rn-push-notifications --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rn Push Notifications?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rn Push Notifications
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lukedj78-rn-push-notifications/badge)](https://www.skillsdirectory.com/skills/lukedj78-rn-push-notifications)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: rn-push-notifications
description: 'Use when adding push or local notifications to an Expo + RN app: requesting permissions at the right moment, registering for push (Expo push service in dev, APNs/FCM direct in prod), handling foreground + tapped + cold-start notifications, deep linking from a notification payload to a specific route, scheduling local notifications, badge management. Triggers on: "add push notifications", "local notification", "deep link from notification", "iOS/Android push setup", "register for notifications". Not for: backend setup that sends the notifications (rn-backend), animations on a notification badge (rn-animations-gestures).'
---

# rn-push-notifications — guardrail for push + local notifications

> For the current Expo API and per-version details, verify against the Expo docs / MCP `mcp.expo.dev` / `expo/skills` (see rn-fundamentals → Source of truth).

## The 5 rules (non-negotiable)

1. **`expo-notifications` is the SDK**. Don't pull `@react-native-firebase/messaging` directly — Expo wraps APNs+FCM. Bare FCM is needed only for the rare case where you ship without Expo.
2. **Request permission AT THE RIGHT MOMENT**, not at app launch. Wait for a clear opt-in trigger (signup complete, settings screen, feature first use).
3. **Setup `setNotificationHandler` at module level** in `app/_layout.tsx`, ONCE. Not inside any component.
4. **Handle the 3 entry paths**: foreground (`addNotificationReceivedListener`), tapped while alive (`addNotificationResponseReceivedListener`), tapped on cold start (`getLastNotificationResponseAsync`).
5. **Token storage**: send the Expo push token to YOUR backend via authenticated HTTPS POST. Never store the raw token in AsyncStorage — use `expo-secure-store` or treat it as server-owned.

## Quick decision tree

- "Expo push service or direct APNs/FCM?" → `references/decision-tree.md`
- "How do I wire up the handlers + deep linking?" → `references/patterns.md`
- "What's the app.json / config plugin setup?" → `references/setup.md`

## Common anti-patterns (NEVER do)

- ❌ `Notifications.requestPermissionsAsync()` in `app/_layout.tsx` on first render — bad UX (denied permanently if user says no by mistake).
- ❌ `setNotificationHandler` inside a screen component — runs on every mount, last one wins.
- ❌ Sending the Expo push token over plain HTTP — token = ability to spam the user.
- ❌ Reading `notification.request.content.data` without type-narrowing — runtime error on malformed payload.
- ❌ Forgetting `getLastNotificationResponseAsync` on cold start — deep link from tapped notification gets lost.
- ❌ Storing badge count in client state only — server is source of truth; client subtracts on read.

## Sources

- Course: codewithbeto.dev/rnCourse — "Push Notifications" module (1 lesson free, rest paid).
- Official: https://docs.expo.dev/push-notifications/overview/
- Official: https://docs.expo.dev/versions/latest/sdk/notifications/

Files in this skill

  • SKILL.md2.9 KB
  • references/decision-tree.md4.2 KB
  • references/patterns.md6.7 KB
  • references/setup.md3.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.