Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计通过

capacitor-push-notifications电容器推送通知

Agent Skill

capacitor-push-notifications 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

4,493

周安装

180

GitHub Stars

19

下载量

1,454
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:capacitor-push-notifications(电容器推送通知)
来源仓库:https://github.com/capawesome-team/skills
仓库路径:skills/capacitor-push-notifications
安装命令:
npx skills add https://github.com/capawesome-team/skills --skill capacitor-push-notifications
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/capawesome-team/skills --skill capacitor-push-notifications

简介

用于设置和使用 Firebase Cloud Messaging 推送通知。

  • 适合 iOS 和 Android 平台的即时消息推送场景。
  • 需 Firebase 项目和平台开发工具(Xcode/Android Studio)。
  • 可逐步引导完成凭证配置和插件集成流程。
  • 安装前建议确认权限范围,避免触发网络请求或文件修改。

SKILL.md

Capacitor Push Notifications

Set up and use push notifications in Capacitor apps using Firebase Cloud Messaging (FCM) via the @capacitor-firebase/messaging plugin.

Prerequisites

  1. Capacitor 6, 7, or 8 app.
  2. Node.js and npm installed.
  3. A Firebase project. Create one at Firebase console if needed.
  4. For iOS: A paid Apple Developer Program membership and Xcode installed.
  5. For Android: Android Studio installed.
  6. @capacitor/push-notifications must not be installed — it conflicts with @capacitor-firebase/messaging.

Agent Behavior

  • Guide step-by-step. Walk the user through the process one step at a time. Never present multiple unrelated questions at once.
  • Auto-detect before asking. Check the project for platforms (android/, ios/), build tools, framework, and package.json dependencies. Only ask the user when something cannot be detected.
  • One decision at a time. When a step requires user input, ask that single question, wait for the answer, then continue.
  • Present clear options. Provide concrete choices (e.g., "Do you want to configure topic subscriptions? (yes/no)") instead of open-ended questions.

Procedures

Step 1: Analyze the Project

Auto-detect the following by reading project files — do not ask the user for information that can be inferred:

  1. Platforms: Check which directories exist (android/, ios/). These are the platforms to configure.
  2. Build tool / framework: Check for vite.config.ts, angular.json, webpack.config.js, next.config.js, etc.
  3. Capacitor version: Read @capacitor/core version from package.json.
  4. Conflicting plugins: Check if @capacitor/push-notifications is in package.json. If found, warn the user it must be removed before proceeding: npm uninstall @capacitor/push-notifications

Step 2: Set Up Firebase

Check if Firebase is already configured in the project:

  • Android: Check if android/app/google-services.json exists.
  • iOS: Check if 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.

Step 3: Install the Plugin

npm install @capacitor-firebase/messaging firebase
npx cap sync

Step 4: Configure Android

Skip if android/ does not exist.

Read references/android-setup.md and apply the Android-specific configuration.

Step 5: Configure iOS

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.

Step 6: Configure Web (if applicable)

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.

Step 7: Configure Capacitor Plugin Options

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"].

Step 8: Add Push Notification Code

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:

  1. Requesting permissions
  2. Retrieving the FCM token
  3. Listening for incoming notifications
  4. Handling notification taps

Step 9: Configure Optional Features

Ask the user which optional features to enable:

  1. Topic subscriptions — Subscribe/unsubscribe to FCM topics (Android/iOS only).
  2. Notification channels — Create custom Android notification channels (Android SDK 26+ only).
  3. Token refresh listener — Listen for FCM token changes.

For each selected feature, read references/implementation.md and apply the relevant code.

Step 10: Sync and Test

  1. Sync the project: npx cap sync
  2. Read references/testing.md and guide the user through sending a test notification via the Firebase Console.

Error Handling

  • @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.
  • iOS: No push notifications received: Verify APNs key/certificate is uploaded to Firebase Console. Verify Push Notifications and Background Modes capabilities are enabled. Verify AppDelegate.swift contains the required delegate methods.
  • iOS: 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.
  • Android: No push notifications received: Verify google-services.json is at android/app/google-services.json. Verify the Google services Gradle plugin is applied.
  • Android: White square notification icon: The notification icon must be white pixels on a transparent background. Application icons with color will render as a white square. Add a dedicated push notification icon.
  • Web: 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.
  • FCM token is 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).
  • Android 13+: No permission prompt: On Android 13 (API 33) and above, requestPermissions() must be called explicitly. Earlier Android versions grant notification permission by default.

Related Skills

  • 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.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.04%
按下载量换算495

Claude

32.54%
按下载量换算473

Cursor

19.74%
按下载量换算287

Gemini CLI

10.52%
按下载量换算153

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills