/capacitor-integrations:capacitor-push-notificationsfrom capacitor-integrations
Guides setting up push notifications in Capacitor apps with Firebase Cloud Messaging via @capacitor-firebase/messaging. Covers Firebase project setup, plugin installation for Capacitor 6-8, platform config (Android, iOS, Web), APNs keys, permissions, FCM tokens, topic subscriptions, and testing.
Ships in capacitor-integrations. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Set up and use push notifications in Capacitor apps using Firebase Cloud Messaging (FCM) via the @capacitor-firebase/messaging plugin.
A Capacitor 6, 7, or 8 app. Capacitor 9 is not covered by this skill yet. The plugin major version must match the Capacitor major version:
| Capacitor | Plugin version | firebase (Web SDK) | Status |
|---|---|---|---|
| 8 | 8.x | ^12.6.0 | Active support |
| 7 | 7.x | ^11.2.0 | Deprecated |
| 6 | 6.x | ^10.9.0 || ^11.0.0 | Deprecated |
Node.js and npm installed.
A Firebase project. Create one at Firebase console if needed.
For iOS: A paid Apple Developer Program membership and Xcode installed. Plugin version 8 needs an iOS deployment target of 15.0 or later.
For Android: Android Studio installed. Plugin version 8 needs minSdkVersion 24 or later.
@capacitor/push-notifications must not be installed — it conflicts with @capacitor-firebase/messaging.
android/, ios/), build tools, framework, and package.json dependencies. Only ask the user when something cannot be detected..p8 key and a Firebase service account key are secrets. Keep them out of the repository and out of the terminal output.Two hosted MCP servers serve the current documentation, so both are always ahead of the guidance bundled with this skill:
capacitor.config file, the native Android and iOS projects, and the official plugin APIs.Both expose search_docs and get_doc_page, so pick the server by topic before calling either.
search_docs on the server that owns the topic and read the matching page with get_doc_page before applying the guidance below. Where the two disagree, follow the documentation.claude mcp add --transport http capawesome "https://mcp.capawesome.io/mcp"
claude mcp add --transport http capacitor "https://capacitor-mcp.capawesome.io/mcp"
Neither server needs an account or a token for documentation. See the capawesome-mcp and capacitor-mcp skills for full setup, including the Capawesome Cloud tools.
Auto-detect the following by reading project files — do not ask the user for information that can be inferred:
android/, ios/). These are the platforms to configure.vite.config.ts, angular.json, webpack.config.js, next.config.js, etc.@capacitor/core and @capacitor/cli versions from package.json. Record the major version of @capacitor/core and the full version of @capacitor/cli.ios/ exists): If ios/App/CapApp-SPM/Package.swift exists, the project uses Swift Package Manager. If ios/App/Podfile exists, it uses CocoaPods.@capacitor/push-notifications is in package.json. If found, warn the user it must be removed before proceeding:
npm uninstall @capacitor/push-notifications
Check if Firebase is already configured in the project:
android/app/google-services.json exists.ios/App/App/GoogleService-Info.plist exists and is part of the Xcode project: grep -c "GoogleService-Info.plist" ios/App/App.xcodeproj/project.pbxproj must print a number above 0.If Firebase is not configured for a detected platform, read references/firebase-setup.md and guide the user through the Firebase setup for each missing platform. The APNs key for iOS is part of that file.
If the files already exist, two things can still be missing. Check them in references/firebase-setup.md:
grep commands of the section "Check the Google Services Gradle Plugin".Install the plugin version that matches the Capacitor major version recorded in Step 1:
# Capacitor 8
npm install @capacitor-firebase/messaging@8 firebase@^12.6.0
# Capacitor 7
npm install @capacitor-firebase/messaging@7 firebase@^11.2.0
# Capacitor 6
npm install @capacitor-firebase/messaging@6 firebase@^11.0.0
Run only the line for the detected version. The firebase package is the Firebase JavaScript SDK. The plugin uses it on the Web platform only.
Do not run npx cap sync yet. Step 10 runs it once after all changes.
Skip if android/ does not exist.
Read references/android-setup.md and apply the Android-specific configuration.
Skip if ios/ does not exist.
Read references/ios-setup.md and apply the iOS-specific configuration. This includes the Swift Package Manager option, the AppDelegate.swift methods, and the Push Notifications and Background Modes capabilities.
If the project targets the web (detected via build tool config or user confirmation):
Read references/web-setup.md and apply the Web-specific configuration.
Ask the user if they want to customize how iOS presents a notification while the app is in the foreground. If yes, update the Capacitor configuration file.
In capacitor.config.json:
{
"plugins": {
"FirebaseMessaging": {
"presentationOptions": ["alert", "badge", "sound"]
}
}
}
In capacitor.config.ts, also add the type reference as the first line of the file:
+/// <reference types="@capacitor-firebase/messaging" />
+
import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
+ plugins: {
+ FirebaseMessaging: {
+ presentationOptions: ['alert', 'badge', 'sound'],
+ },
+ },
};
Available values:
badge: the badge count on the app icon is updated.sound: the device rings or vibrates when the push notification is received.alert: the push notification is displayed as a banner and in the notification list.criticalAlert: the push notification is displayed in a native dialog and bypasses the mute switch.The default is ["alert", "badge", "sound"]. An empty array disables all of them. The option only has an effect on iOS.
Read references/implementation.md and add the push notification code to the project. Adapt imports and structure to match the user's framework.
The implementation covers:
Ask the user which optional features to enable:
For each selected feature, read references/implementation.md and apply the relevant code.
Sync the project:
npx cap sync
Read references/testing.md and guide the user through sending a test notification via the Firebase Console.
@capacitor/push-notifications conflict: The @capacitor-firebase/messaging plugin cannot coexist with @capacitor/push-notifications. Uninstall the conflicting plugin: npm uninstall @capacitor/push-notifications && npx cap sync.npm install fails with a peer dependency conflict: The plugin major version does not match the Capacitor major version, or the firebase version is outside the supported range. Use the line for the detected Capacitor version in Step 3.packageOptions entry with symlink: true from references/ios-setup.md. It needs Capacitor CLI 8.4.0 or later.aps-environment is in the entitlements file of the app and remote-notification is in ios/App/App/Info.plist, with the checks in references/ios-setup.md. Verify ios/App/App/AppDelegate.swift contains the three methods from references/ios-setup.md.didRegisterForRemoteNotificationsWithDeviceToken not called: Ensure the Push Notifications capability is enabled. Check that the app's bundle ID matches the one registered in Firebase and in the Apple Developer portal.GoogleService-Info.plist exists on disk but is not part of the Xcode project. Run the grep check from Step 2.google-services.json is at android/app/google-services.json. Verify the Google services Gradle plugin is applied, see references/firebase-setup.md.getToken() fails: Ensure the VAPID key is correct. Ensure firebase-messaging-sw.js exists at the root of the domain or pass a serviceWorkerRegistration. Call isSupported() to check that the browser supports the required APIs.UNIMPLEMENTED: Topic subscriptions, notification channels and the delivered notification methods do not exist on the Web. Guard the calls with Capacitor.isNativePlatform().null: Ensure requestPermissions() was called and returned granted before calling getToken(). On iOS, verify the device is not a simulator (simulators cannot receive push notifications).notificationReceived does not fire in the background: This is the expected behavior. In the background the listener is only called for data push notifications on Android and for silent push notifications (messages with the content-available key) on iOS.checkPermissions() returns denied: The user has denied notification permissions. Guide them to re-enable via device settings (Settings > App > Notifications).requestPermissions() must be called explicitly. Earlier Android versions grant notification permission by default.capacitor-app-development — For general Capacitor development topics, troubleshooting, and best practices.capacitor-plugins — For general Capacitor plugin installation and configuration, including other Firebase plugins.capacitor-app-upgrades: Upgrade the app to Capacitor 8 to use the actively supported plugin version.capawesome-cloud: Build and sign the iOS and Android app in the cloud after push notifications are set up.capawesome-mcp — Connect an MCP client to the hosted Capawesome MCP server for always-current documentation and Capawesome Cloud management.capacitor-mcp: Connect an MCP client to the hosted Capacitor MCP server for the current Capacitor documentation.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub capawesome-team/skills --plugin capacitor-integrations2 skills in this plugin
Other plugins' skills for the same job