Push notifications
Skill launch52-ai/flutter-template/.claude/skills/push-notifications
Template for Flutter mobile applications.
npx -y skills add launch52-ai/flutter-template --skill push-notificationsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Push notifications with Firebase Cloud Messaging (FCM). Platform setup, APNs certificates, foreground/background handling, deep linking, topic subscriptions, local notifications. Use when implementing push notifications or troubleshooting FCM.
SKILL.md
4.8 KB, as published. Nobody here has run it
Push Notifications - Firebase Cloud Messaging
Push notifications with FCM for iOS and Android. Handles foreground, background, and terminated app states.
When to Use This Skill
- Adding push notifications to a Flutter app
- Configuring Firebase Cloud Messaging
- Setting up APNs for iOS
- Implementing deep linking from notifications
- User asks "add push notifications", "FCM setup", or "notification handling"
Questions to Ask
- Firebase project: Is Firebase already configured, or need to set up from scratch?
- Notification types: Marketing notifications only, or also transactional (in-app events)?
- Deep linking: Should notifications open specific screens?
- Topics: Need topic-based subscriptions (e.g., "news", "promotions")?
- Local notifications: Need scheduled/local notifications (non-push)?
Reference Files
reference/
├── models/ # Notification payload (Freezed)
├── services/ # FCM initialization, handlers
├── repositories/ # Domain interface + impl + mock
├── providers/ # Riverpod notifiers + state
└── failures/ # Sealed Failure types
templates/ios/ # Info.plist additions
templates/android/ # AndroidManifest, build.gradle
See: implementation-guide.md for complete setup.
Workflow
Phase 1: Firebase Setup
- Create Firebase project (if needed)
- Add iOS app with APNs key (see firebase-setup-guide.md)
- Add Android app with SHA-1 fingerprints
- Download config files (GoogleService-Info.plist, google-services.json)
Phase 2: Platform Config
- iOS: Add Push Notification capability, Background Modes
- Android: Add FCM dependencies and manifest entries
- Add config files to project
Phase 3: Implementation
- Copy reference files to project
- Initialize FCM in main.dart
- Implement token registration with backend
- Add notification handlers (foreground/background/terminated)
- Configure deep linking (optional)
Core API
await PushNotificationService.initialize();
final token = await PushNotificationService.getToken();
PushNotificationService.onNotificationTap.listen((payload) => ...);
Notification States
| State | Handler | Behavior |
|---|---|---|
| Foreground | onMessage | Show local notification or in-app banner |
| Background | onBackgroundMessage | System shows notification |
| Terminated | getInitialMessage | Check on app launch |
Failure Types
| Type | When | UI Action |
|---|---|---|
PermissionDeniedFailure | User denied permission | Settings prompt |
TokenRegistrationFailure | Backend token save failed | Silent retry |
NotificationNetworkFailure | Connection error | Retry later |
InvalidPayloadFailure | Malformed notification | Log and ignore |
Platform Requirements
iOS
- APNs Key or Certificate in Firebase Console
- Push Notification capability
- Background Modes: Remote notifications
Info.plist: FirebaseAppDelegateProxyEnabled = NO (if handling manually)
Android
google-services.jsoninandroid/app/- FCM dependency in
build.gradle - Default notification channel
Guides
| File | Content |
|---|---|
| implementation-guide.md | Step-by-step code setup |
| firebase-setup-guide.md | Firebase Console + APNs setup |
| checklist.md | Verification checklist |
Dependencies
dependencies:
firebase_core: ^3.9.0
firebase_messaging: ^15.2.0
flutter_local_notifications: ^18.0.1 # For foreground display
Checklist
- Firebase project created with iOS and Android apps
- APNs key uploaded to Firebase Console
-
GoogleService-Info.plistadded to iOS Runner -
google-services.jsonadded toandroid/app/ - iOS: Push Notification capability added
- iOS: Background Modes enabled (Remote notifications)
- Android: FCM dependencies in build.gradle
- PushNotificationService initialized in main.dart
- FCM token sent to backend on login/refresh
- Foreground notification handler configured
- Background notification handler registered
- Deep linking configured (if needed)
- Permission request flow implemented
Related Skills
/release- iOS capabilities, Android signing/design- In-app notification banners/i18n- Localized notification content/testing- Test notification flows