ishwormali/habbitpoint/firebase-messaging
Claude Code and agent skill by ishwormali/habbitpoint
- community
Checking that the SKILL.md file is still in the repository.
Integrates Firebase Cloud Messaging (FCM) into Flutter apps. Use when setting up push notifications, handling foreground/background messages, managing permissions, working with FCM tokens, or configuring platform-specific notification behavior.
Install
npx vskill@latest install ishwormali/habbitpoint/firebase-messagingSKILL.md
The same SKILL.md was published earlier as ishwormali/habbitpoint/firebase-messaging.
Firebase Cloud Messaging Skill
This skill defines how to correctly use Firebase Cloud Messaging (FCM) in Flutter applications.
When to Use
Use this skill when:
- Setting up push notifications with FCM in a Flutter project.
- Handling messages in foreground, background, and terminated states.
- Managing notification permissions and FCM tokens.
- Configuring platform-specific notification display behavior.
1. Setup and Configuration
iOS:
- Enable Push Notifications and Background Modes in Xcode.
- Upload your APNs authentication key to Firebase before using FCM.
- Do not disable method swizzling — it is required for FCM token handling.
- Ensure the bundle ID for your APNs certificate matches your app's bundle ID.
Android:
- Devices must run Android 4.4+ with Google Play services installed.
- Check for Google Play services compatibility in both
onCreate()andonResume().
Web:
- Create and register a service worker file named
firebase-messaging-sw.jsin yourweb/directory:
2. Message Handling
Foreground messages:
Background messages:
Background handler rules:
- Must be a top-level function (not anonymous, not a class method).
- Annotate with
@pragma('vm:entry-point')(Flutter 3.3.0+) to prevent removal during tree shaking in release mode. - Cannot update app state or execute UI-impacting logic — runs in a separate isolate.
- Call
Firebase.initializeApp()before using any other Firebase services.
3. Permissions
- iOS / macOS / Web / Android 13+: Must request permission before receiving FCM payloads.
- Android < 13:
authorizationStatusreturnsauthorizedif the user has not disabled notifications in OS settings. - Android 13+: Track permission requests in your app — there's no way to determine if the user chose to grant/deny.
- Use provisional permissions on iOS (
provisional: true) to let users choose notification types after receiving their first notification.
4. Token Management
Get FCM registration token (use to send messages to a specific device):
Web — provide VAPID key:
Listen for token refresh:
Apple platforms — ensure APNS token is available before FCM calls:
5. Platform-Specific Behavior
- iOS: If the user swipes away the app from the app switcher, it must be manually reopened for background messages to work again.
- Android: If the user force-quits from device settings, the app must be manually reopened.
- Android foreground notifications: Create a "High Priority" notification channel to display notifications while the app is in the foreground.
- iOS foreground notifications: Update presentation options to display notifications while the app is in the foreground.
6. Auto-Initialization Control
Disable auto-init — iOS (Info.plist):
Disable auto-init — Android (AndroidManifest.xml):
Re-enable at runtime:
- The auto-init setting persists across app restarts once set.
7. iOS Image Notifications
Important: The iOS simulator does not display images in push notifications. Test on a physical device.
- Add a Notification Service Extension in Xcode.
- Use
Messaging.serviceExtension().populateNotificationContent()in the extension for image handling. - Swift: add the
FirebaseMessagingSwift package to your extension target. - Objective-C: add the
Firebase/Messagingpod to your Podfile.
References
Security
- Security scanPassed, 90 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 repositoryChecking.skills/firebase-messaging/SKILL.md
Popularity
- 7-day trend score
- 0
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/ishwormali/habbitpoint/firebase-messaging)