skills/capacitor-push-notifications/SKILL.md
Guides the agent through setting up and using push notifications in Capacitor apps using Firebase Cloud Messaging via the @capacitor-firebase/messaging plugin. Covers Firebase project setup, plugin installation, platform-specific configuration (Android, iOS, Web), APNs certificate setup, requesting permissions, retrieving FCM tokens, listening for notifications, topic subscriptions, notification channels, and testing. Do not use for local notifications, non-Firebase push providers, migrating Capacitor apps or plugins, or non-Capacitor mobile frameworks.
npx skillsauth add capawesome-team/skills capacitor-push-notificationsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Set up and use push notifications in Capacitor apps using Firebase Cloud Messaging (FCM) via the @capacitor-firebase/messaging plugin.
@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.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 version from package.json.@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.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.
npm install @capacitor-firebase/messaging firebase
npx cap sync
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 APNs key/certificate setup, AppDelegate.swift modifications, and enabling 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 iOS foreground notification presentation. If yes, update capacitor.config.json or capacitor.config.ts:
{
"plugins": {
"FirebaseMessaging": {
"presentationOptions": ["alert", "badge", "sound"]
}
}
}
Available options: badge, sound, alert, criticalAlert. Default is ["alert", "badge", "sound"].
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.AppDelegate.swift contains the required delegate methods.didRegisterForRemoteNotificationsWithDeviceToken not called: Ensure the Push Notifications capability is added in Xcode under Signing & Capabilities. Check that the app's bundle ID matches the one registered in Firebase and Apple Developer portal.google-services.json is at android/app/google-services.json. Verify the Google services Gradle plugin is applied.getToken() fails: Ensure the VAPID key is correct. Ensure firebase-messaging-sw.js exists at the root of the domain. Check that the browser supports the Push API.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).checkPermissions() returns denied: The user has permanently 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.tools
A comprehensive starting point for AI agents to work with the Ionic Framework. Covers core concepts, components, CLI, theming, layout, lifecycle, navigation, and framework-specific patterns for Angular, React, and Vue. Pair with the other Ionic skills in this collection for deeper topic-specific guidance like app creation, framework integration, and upgrades.
tools
Guides the agent through setting up and using Capawesome Cloud for Capacitor and Cordova apps. Covers three core workflows: (1) Native Builds — cloud builds for iOS and Android (Capacitor, Cordova, or native projects), signing certificates, environments, Trapeze configuration, and build artifacts; (2) Live Updates — OTA updates via the @capawesome/capacitor-live-update or @capawesome/cordova-live-update plugin, channels, versioning, rollbacks, and code signing; (3) App Store Publishing — automated submissions to Apple App Store (TestFlight) and Google Play Store. Includes CI/CD integration for all workflows. Do not use for non-Capacitor, non-Cordova mobile frameworks such as React Native or Flutter.
tools
Guides the agent through installing, authenticating, configuring, and using the Capawesome CLI (@capawesome/cli). Covers installation, interactive and token-based authentication, project linking via capawesome.config.json, the full command reference (app management, native builds, live updates, certificates, environments, channels, deployments, destinations, devices), CI/CD integration with token auth and JSON output, and diagnostics via the doctor command. Do not use for Capawesome Cloud feature setup (native builds workflow, live updates workflow, app store publishing) — use the capawesome-cloud skill instead.
tools
A comprehensive starting point for AI agents to work with Capacitor. Covers core concepts, CLI, app creation, plugins, framework integration, best practices, storage, security, testing, troubleshooting, upgrading, and Capawesome Cloud (live updates, native builds, app store publishing). Pair with the other Capacitor skills in this collection for deeper topic-specific guidance.