home / skills / hoangnguyen0403 / agent-skills-standard / android-notifications
This skill helps you implement Android push notifications with Firebase Cloud Messaging, proper channels, and permission handling for a robust user experience.
npx playbooks add skill hoangnguyen0403/agent-skills-standard --skill android-notificationsReview the files below or copy the command above to add this skill to your agents.
---
name: Android Notifications
description: Push notifications for Android using Firebase Cloud Messaging and NotificationCompat.
metadata:
labels: [android, fcm, notifications, push, notification-channels]
triggers:
files: ['**/*Notification*.kt', '**/MainActivity.kt']
keywords: [FirebaseMessaging, NotificationCompat, NotificationChannel, FCM]
---
# Android Notifications
## **Priority: P2 (OPTIONAL)**
Push notifications using Firebase Cloud Messaging.
## Guidelines
- **Service**: Implement `FirebaseMessagingService` for handling background messages.
- **Channels**: Must create `NotificationChannel` for Android 8.0+ compatibility.
- **Permissions**: Request `POST_NOTIFICATIONS` explicitly on Android 13+.
- **Intents**: Handle notification taps in both `onCreate` and `onNewIntent`.
- **Priming**: Show benefit dialog before requesting system permissions.
[Implementation Details](references/implementation.md)
## Anti-Patterns
- **No Missing Channel**: Notifications fail silently without channels on API 26+.
- **No Unconditional Requests**: Don't spam permission dialog on first launch.
- **No Missing Manifest**: Service must be declared with `MESSAGING_EVENT` action.
## Related Topics
android-navigation | android-design-system | mobile-ux-core
This skill covers implementing push notifications on Android using Firebase Cloud Messaging (FCM) and NotificationCompat. It focuses on reliable background handling, channel creation for API 26+, and permission flows for modern Android. Practical guidance and common anti-patterns help prevent silent failures and poor UX.
The skill explains how to register and implement FirebaseMessagingService to receive background and data messages. It describes creating NotificationChannel for Android 8.0+ and building notifications with NotificationCompat to ensure consistent rendering. It also covers requesting POST_NOTIFICATIONS on Android 13+ and handling notification taps via intents in both onCreate and onNewIntent.
What happens if I don’t create a NotificationChannel on Android 8+?
Notifications can fail to appear or behave inconsistently; channels are required for proper delivery and user controls on API 26 and above.
When should I request POST_NOTIFICATIONS permission?
Request it only when the user understands the benefit, ideally after a priming dialog or when they opt into notifications in settings, to avoid poor UX and denied permission.