shekhar23/claude-zero-to-hero-android-kmp/android-notifications-push
Claude Code and agent skill by shekhar23/claude-zero-to-hero-android-kmp
- community
Checking that the SKILL.md file is still in the repository.
Push notification and local notification patterns for Android - FCM setup, FirebaseMessagingService, notification channels, NotificationCompat.Builder, deep-link on tap via PendingIntent and NavDeepLinkBuilder, foreground vs background delivery, POST_NOTIFICATIONS permission on Android 13+, data-only vs notification messages, grouping, and badges. Use this skill whenever adding push notifications, configuring Firebase Cloud Messaging, showing local notifications, handling notification taps, or creating notification channels. Trigger on phrases like "push notification", "FCM", "Firebase messaging", "notification channel", "local notification", "notification tap", "POST_NOTIFICATIONS", "data message", or "notification badge".
Install
npx vskill@latest install shekhar23/claude-zero-to-hero-android-kmp/android-notifications-pushSKILL.md
Android Notifications and Push (FCM)
Core Principles
- Create notification channels once at app startup, never lazily on first use.
- Every notification must belong to a channel — the system ignores notifications without one on API 26+.
- Request POST_NOTIFICATIONS permission before showing any notification on Android 13+ (API 33+).
- Keep FirebaseMessagingService thin: parse the message payload, delegate to a use case or repository.
- Data-only FCM messages always arrive in onMessageReceived; notification messages only arrive there when the app is in the foreground.
- Deep-link destinations on tap must be validated exactly as external deep links — they are untrusted input.
Project Setup
Gradle dependencies
Add google-services.json to the app/ directory and apply the plugin:
Notification Channels
Create channels once in Application.onCreate() — creating an existing channel is a no-op after the first call.
Call from Application:
Anti-pattern: creating channels in a fragment, ViewModel, or lazy block — if the first notification arrives before lazy initialization, it silently fails.
POST_NOTIFICATIONS Permission (Android 13+)
Declare in AndroidManifest.xml:
Request it just before the user enables notifications in settings, following the same pattern as other runtime permissions. See android-permissions-device-apis for the full rationale/permanent-denial flow.
Check before showing a local notification:
FirebaseMessagingService
Register in AndroidManifest.xml:
Data-Only vs Notification Messages
| Message type | App foreground | App background / killed | |
|---|---|---|---|
| Notification message | onMessageReceived | System tray — FCM shows it automatically, onMessageReceived NOT called | |
| Data-only message | onMessageReceived | onMessageReceived (high-priority) |
Prefer data-only messages for production apps so you control the notification appearance in all states and can apply deep-link logic uniformly.
Send data-only from the server:
Local Notifications with NotificationCompat
Anti-pattern: using FLAG_MUTABLE when the extra data is set at build time and will not be modified by external processes.
Deep-Link on Notification Tap (Compose Navigation)
For Compose Navigation, build the tap intent from a validated URI:
Declare the deep-link route in the Compose nav graph:
Always validate the URI components before acting on them — see android-deep-links.
Foreground vs Background Delivery
When the app is in the foreground and a push arrives, onMessageReceived is called but no system notification appears for notification messages. You must call NotificationHelper.showPush(...) yourself.
Good pattern:
Anti-pattern: relying solely on the FCM SDK to display notification messages — you lose control of appearance, channel assignment, and deep-link handling when the app is in the background.
Notification Grouping
Group related notifications so the tray does not fill up for apps that post many updates:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/android-notifications-push/SKILL.md
Popularity
- Repository stars
- 9
- Repository forks
- 5
- 7-day trend score
- 12
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/shekhar23/claude-zero-to-hero-android-kmp/android-notifications-push)