{"_id":"@capgo/capacitor-firebase-messaging","_rev":"4-758efa44dddcf0242d2d18b191acc5c7","name":"@capgo/capacitor-firebase-messaging","dist-tags":{"latest":"7.4.2"},"versions":{"7.4.0":{"name":"@capgo/capacitor-firebase-messaging","version":"7.4.0","keywords":["capacitor","plugin","native"],"author":{"name":"Capgo Team"},"license":"Apache-2.0","_id":"@capgo/capacitor-firebase-messaging@7.4.0","maintainers":[{"name":"riderx","email":"martin.donadieu@hey.com"}],"homepage":"https://capgo.app/","bugs":{"url":"https://github.com/Cap-go/capacitor-firebase/issues"},"dist":{"shasum":"d1e8392d386f0e08371e17b439d7ebd8a5c4eb14","tarball":"https://registry.npmjs.org/@capgo/capacitor-firebase-messaging/-/capacitor-firebase-messaging-7.4.0.tgz","fileCount":32,"integrity":"sha512-klcPmOFcUBBR/6suxLWrYsubDar3veeg0j7qbfEYVFX4ODw1pEpMcNuSlZzY7Lw8GREZEx1qqOn5tFHLSreSEQ==","signatures":[{"sig":"MEUCIQD/mjb6H26ugdVmuq4dtjNOzR9U4NF/QoagDbUGFV5yhAIgWKD1yzCnIMXvsVQjgXvn8Tiv3I3LmBRvBGv+2N+8O2A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":199290},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","gitHead":"97786da96a720a520f80ac1031a0f12063f135d7","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api CapgoFirebaseMessagingPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","prettier":"prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java","swiftlint":"node-swiftlint","verify:ios":"xcodebuild -scheme CapgoCapacitorFirebaseMessaging -destination generic/platform=iOS","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd ..","ios:pod:install":"cd ios && pod install --repo-update && cd ..","ios:spm:install":"cd ios && swift package resolve && cd .."},"_npmUser":{"name":"riderx","email":"martin.donadieu@hey.com"},"prettier":"@ionic/prettier-config","capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/Cap-go/capacitor-firebase.git","type":"git"},"_npmVersion":"11.6.2","description":"Capacitor plugin for Firebase Cloud Messaging (FCM).","directories":{},"_nodeVersion":"24.11.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","rimraf":"6.0.1","rollup":"4.30.1","firebase":"12.6.0","prettier":"3.4.2","swiftlint":"2.0.0","typescript":"4.1.5","@capacitor/cli":"7.0.0","@capacitor/ios":"7.0.0","@capacitor/core":"7.0.0","@capacitor/docgen":"0.3.0","@capacitor/android":"7.0.0","@ionic/eslint-config":"0.4.0","prettier-plugin-java":"2.6.7","@ionic/prettier-config":"^4.0.0","@ionic/swiftlint-config":"2.0.0"},"peerDependencies":{"firebase":"12.6.0","@capacitor/core":">=7.0.0"},"peerDependenciesMeta":{"firebase":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/capacitor-firebase-messaging_7.4.0_1763998914391_0.6359165026801457","host":"s3://npm-registry-packages-npm-production"}},"7.4.1":{"name":"@capgo/capacitor-firebase-messaging","version":"7.4.1","keywords":["capacitor","plugin","native"],"author":{"name":"Capgo Team"},"license":"Apache-2.0","_id":"@capgo/capacitor-firebase-messaging@7.4.1","maintainers":[{"name":"riderx","email":"martin.donadieu@hey.com"}],"homepage":"https://capgo.app/","bugs":{"url":"https://github.com/Cap-go/capacitor-firebase/issues"},"dist":{"shasum":"6f6463acbe87aecf5d85582aab6377dbc5a31d09","tarball":"https://registry.npmjs.org/@capgo/capacitor-firebase-messaging/-/capacitor-firebase-messaging-7.4.1.tgz","fileCount":32,"integrity":"sha512-zt5zB/Z6huiZa60Q7ydnEaYvSGpMb71qtc3p3kx4fksNKM5RR1DhtpwwBSoNlCDzlQrtkP98cnyq6xJnSRYEFA==","signatures":[{"sig":"MEQCIHtIOOtS/ZMdgUxMkhGR0S0g9x8Wr2Ou0s5DMgYx2WHsAiA9tY2Chl8WRw2UOP4OFkOIE4xDc7PpF6FJ5NM0uKj4Pw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":199173},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","gitHead":"c965f5a7def32792245434af874be9775557c34d","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api FirebaseMessagingPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","prettier":"prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java","swiftlint":"node-swiftlint","verify:ios":"xcodebuild -scheme CapgoCapacitorFirebaseMessaging -destination generic/platform=iOS","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd ..","ios:pod:install":"cd ios && pod install --repo-update && cd ..","ios:spm:install":"cd ios && swift package resolve && cd .."},"_npmUser":{"name":"riderx","email":"martin.donadieu@hey.com"},"prettier":"@ionic/prettier-config","capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/Cap-go/capacitor-firebase.git","type":"git"},"_npmVersion":"11.6.2","description":"Capacitor plugin for Firebase Cloud Messaging (FCM).","directories":{},"_nodeVersion":"24.11.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","rimraf":"6.0.1","rollup":"4.30.1","firebase":"12.6.0","prettier":"3.4.2","swiftlint":"2.0.0","typescript":"4.1.5","@capacitor/cli":"7.0.0","@capacitor/ios":"7.0.0","@capacitor/core":"7.0.0","@capacitor/docgen":"0.3.0","@capacitor/android":"7.0.0","@ionic/eslint-config":"0.4.0","prettier-plugin-java":"2.6.7","@ionic/prettier-config":"^4.0.0","@ionic/swiftlint-config":"2.0.0"},"peerDependencies":{"firebase":"12.6.0","@capacitor/core":">=7.0.0"},"peerDependenciesMeta":{"firebase":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/capacitor-firebase-messaging_7.4.1_1763999739781_0.08359023263294962","host":"s3://npm-registry-packages-npm-production"}},"7.4.2":{"name":"@capgo/capacitor-firebase-messaging","version":"7.4.2","keywords":["capacitor","plugin","native"],"author":{"name":"Capgo Team"},"license":"MPL-2.0","_id":"@capgo/capacitor-firebase-messaging@7.4.2","maintainers":[{"name":"riderx","email":"martin.donadieu@hey.com"}],"homepage":"https://capgo.app/","bugs":{"url":"https://github.com/Cap-go/capacitor-firebase/issues"},"dist":{"shasum":"75fe7e697367fb41e9f8401c11f57d2fec200270","tarball":"https://registry.npmjs.org/@capgo/capacitor-firebase-messaging/-/capacitor-firebase-messaging-7.4.2.tgz","fileCount":32,"integrity":"sha512-5006535UKM3E0woYGXAICh6V2swOl+CipePtg0eX4oUECf6VGXXviBgCNHMAHfsRVsgPh50dSqd+NGiE+xiWTg==","signatures":[{"sig":"MEQCIHJJ8r+Wk3OTvXN9A6/yca/JsdnTC9sSfEvRHGiEIkV/AiBw2Suw/jDSDxVkggMIE7YGB/EkhjPwPX228yACY8hcOg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":204555},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","gitHead":"8d8a06c3dfefe13eb43aaf4313ef701ee9a76767","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api FirebaseMessagingPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","prettier":"prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java","swiftlint":"node-swiftlint","verify:ios":"xcodebuild -scheme CapgoCapacitorFirebaseMessaging -destination generic/platform=iOS","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd ..","ios:pod:install":"cd ios && pod install --repo-update && cd ..","ios:spm:install":"cd ios && swift package resolve && cd .."},"_npmUser":{"name":"riderx","email":"martin.donadieu@hey.com"},"prettier":"@ionic/prettier-config","capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/Cap-go/capacitor-firebase.git","type":"git"},"_npmVersion":"11.6.2","description":"Capacitor plugin for Firebase Cloud Messaging (FCM).","directories":{},"_nodeVersion":"24.11.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","rimraf":"6.0.1","rollup":"4.30.1","firebase":"12.6.0","prettier":"3.4.2","swiftlint":"2.0.0","typescript":"4.1.5","@capacitor/cli":"7.0.0","@capacitor/ios":"7.0.0","@capacitor/core":"7.0.0","@capacitor/docgen":"0.3.0","@capacitor/android":"7.0.0","@ionic/eslint-config":"0.4.0","prettier-plugin-java":"2.6.7","@ionic/prettier-config":"^4.0.0","@ionic/swiftlint-config":"2.0.0"},"peerDependencies":{"firebase":"12.6.0","@capacitor/core":">=7.0.0"},"peerDependenciesMeta":{"firebase":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/capacitor-firebase-messaging_7.4.2_1764858712404_0.9632150906315207","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-11-24T15:41:54.336Z","modified":"2026-08-19T10:40:46.792Z","7.4.0":"2025-11-24T15:41:54.562Z","7.4.1":"2025-11-24T15:55:39.992Z","7.4.2":"2025-12-04T14:31:52.573Z"},"bugs":{"url":"https://github.com/Cap-go/capacitor-firebase/issues"},"author":{"name":"Capgo Team"},"license":"MPL-2.0","homepage":"https://capgo.app/","keywords":["capacitor","plugin","native"],"repository":{"url":"git+https://github.com/Cap-go/capacitor-firebase.git","type":"git"},"description":"Capacitor plugin for Firebase Cloud Messaging (FCM).","maintainers":[{"email":"martin.donadieu@hey.com","name":"riderx"},{"email":"tori@capgo.app","name":"torichancapgo"}],"readme":"# @capacitor-firebase/messaging\n\nUnofficial Capacitor plugin for [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging).[^1]\n\n<div class=\"capawesome-z29o10a\">\n  <a href=\"https://cloud.capawesome.io/\" target=\"_blank\">\n    <img alt=\"Deliver Live Updates to your Capacitor app with Capawesome Cloud\" src=\"https://cloud.capawesome.io/assets/banners/cloud-deploy-real-time-app-updates.png?t=1\" />\n  </a>\n</div>\n\n## Guides\n\n- [The Push Notifications Guide for Capacitor](https://capawesome.io/blog/the-push-notifications-guide-for-capacitor/)\n\n## Installation\n\n```bash\nnpm install @capacitor-firebase/messaging firebase\nnpx cap sync\n```\n\nAdd Firebase to your project if you haven't already ([Android](https://github.com/capawesome-team/capacitor-firebase/blob/main/docs/firebase-setup.md#android) / [iOS](https://github.com/capawesome-team/capacitor-firebase/blob/main/docs/firebase-setup.md#ios) / [Web](https://github.com/capawesome-team/capacitor-firebase/blob/main/docs/firebase-setup.md#web)).\n\n### Android\n\n#### Variables\n\nIf needed, you can define the following project variable in your app’s `variables.gradle` file to change the default version of the dependency:\n\n- `$firebaseMessagingVersion` version of `com.google.firebase:firebase-messaging` (default: `24.1.0`)\n\nThis can be useful if you encounter dependency conflicts with other plugins in your project.\n\n#### Push Notification Icon\n\nThe Push Notification icon with the appropriate name should be added to the `android/app/src/main/AndroidManifest.xml` file:\n\n```xml\n<meta-data android:name=\"com.google.firebase.messaging.default_notification_icon\" android:resource=\"@mipmap/push_icon_name\" />\n```\n\nIf no icon is specified, Android uses the application icon, but the push icon should be white pixels on a transparent background. Since the application icon does not usually look like this, it shows a white square or circle. Therefore, it is recommended to provide a separate icon for push notifications.\n\n#### Prevent auto initialization\n\nWhen a registration token is generated, the library uploads the identifier and configuration data to Firebase.\nIf you prefer to prevent token autogeneration, disable Analytics collection and FCM auto initialization by adding these metadata values to the `android/app/src/main/AndroidManifest.xml` file:\n\n```xml\n<meta-data\n    android:name=\"firebase_messaging_auto_init_enabled\"\n    android:value=\"false\" />\n<meta-data\n    android:name=\"firebase_analytics_collection_enabled\"\n    android:value=\"false\" />\n```\n\n### iOS\n\n> **Important**: Make sure that no other Capacitor Push Notification plugin is installed (see [here](https://github.com/capawesome-team/capacitor-firebase/pull/267#issuecomment-1328885820)).\n\nSee [Prerequisites](https://capacitorjs.com/docs/guides/push-notifications-firebase#prerequisites) and complete the prerequisites first.\n\nSee [Upload the APNS Certificate or Key to Firebase](https://capacitorjs.com/docs/guides/push-notifications-firebase#upload-the-apns-certificate-or-key-to-firebase) and follow the instructions to upload the APNS Certificate or APNS Auth Key to Firebase.\n\n> If you have difficulties with the instructions, you can also look at the corresponding sections of [this guide](https://capawesome.io/blog/the-push-notifications-guide-for-capacitor/#ios).\n\nAdd the following to your app's `AppDelegate.swift`:\n\n```swift\nfunc application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {\n  NotificationCenter.default.post(name: .capacitorDidRegisterForRemoteNotifications, object: deviceToken)\n}\n\nfunc application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {\n  NotificationCenter.default.post(name: .capacitorDidFailToRegisterForRemoteNotifications, object: error)\n}\n\nfunc application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {\n    NotificationCenter.default.post(name: Notification.Name.init(\"didReceiveRemoteNotification\"), object: completionHandler, userInfo: userInfo)\n}\n```\n\n**Attention**: If you use this plugin in combination with `@capacitor-firebase/authentication`, then add the following to your app's `AppDelegate.swift`:\n\n```diff\n+ import FirebaseAuth\n\nfunc application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {\n+    if Auth.auth().canHandle(url) {\n+      return true\n+    }\n    return ApplicationDelegateProxy.shared.application(app, open: url, options: options)\n}\n```\n\n#### Prevent auto initialization\n\nWhen a registration token is generated, the library uploads the identifier and configuration data to Firebase.\nIf you prefer to prevent token autogeneration, disable FCM auto initialization by editing your `ios/App/App/Info.plist` and set `FirebaseMessagingAutoInitEnabled` key to `NO`.\n\n### Web\n\n1. See [Configure Web Credentials with FCM](https://firebase.google.com/docs/cloud-messaging/js/client#configure_web_credentials_with) and follow the instructions to configure your web credentials correctly.\n1. Add a `firebase-messaging-sw.js` file to the root of your domain. This file can be empty if you do not want to receive push notifications in the background.\n   See [Setting notification options in the service worker](https://firebase.google.com/docs/cloud-messaging/js/receive#setting_notification_options_in_the_service_worker) for more information.\n\n## Configuration\n\n<docgen-config>\n<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->\n\nOn iOS you can configure the way the push notifications are displayed when the app is in foreground.\n\n| Prop                      | Type                              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | Default                                  | Since |\n| ------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- | ----- |\n| **`presentationOptions`** | <code>PresentationOption[]</code> | This is an array of strings you can combine. Possible values in the array are: - `badge`: badge count on the app icon is updated (default value) - `sound`: the device will ring/vibrate when the push notification is received - `alert`: the push notification is displayed in a native dialog - `criticalAlert`: the push notification is displayed in a native dialog and bypasses the mute switch An empty array can be provided if none of the options are desired. Only available for iOS. | <code>[\"alert\", \"badge\", \"sound\"]</code> | 0.2.2 |\n\n### Examples\n\nIn `capacitor.config.json`:\n\n```json\n{\n  \"plugins\": {\n    \"FirebaseMessaging\": {\n      \"presentationOptions\": [\"alert\", \"badge\", \"sound\"]\n    }\n  }\n}\n```\n\nIn `capacitor.config.ts`:\n\n```ts\n/// <reference types=\"@capgo/capacitor-firebase-messaging\" />\n\nimport { CapacitorConfig } from '@capacitor/cli';\n\nconst config: CapacitorConfig = {\n  plugins: {\n    FirebaseMessaging: {\n      presentationOptions: [\"alert\", \"badge\", \"sound\"],\n    },\n  },\n};\n\nexport default config;\n```\n\n</docgen-config>\n\n## Demo\n\nA working example can be found here: [robingenz/capacitor-firebase-plugin-demo](https://github.com/robingenz/capacitor-firebase-plugin-demo)\n\n## Starter templates\n\nThe following starter templates are available:\n\n- [Ionstarter Angular Firebase](https://ionstarter.dev/)\n\n## Usage\n\n```typescript\nimport { FirebaseMessaging } from '@capacitor-firebase/messaging';\n\nconst checkPermissions = async () => {\n  const result = await FirebaseMessaging.checkPermissions();\n  return result.receive;\n};\n\nconst requestPermissions = async () => {\n  const result = await FirebaseMessaging.requestPermissions();\n  return result.receive;\n};\n\nconst getToken = async () => {\n  const result = await FirebaseMessaging.getToken();\n  return result.token;\n};\n\nconst deleteToken = async () => {\n  await FirebaseMessaging.deleteToken();\n};\n\nconst getDeliveredNotifications = async () => {\n  const result = await FirebaseMessaging.getDeliveredNotifications();\n  return result.notifications;\n};\n\nconst removeDeliveredNotifications = async () => {\n  await FirebaseMessaging.removeDeliveredNotifications({\n    notifications: [\n      {\n        id: '798dfhliblqew89pzads',\n      },\n    ],\n  });\n};\n\nconst removeAllDeliveredNotifications = async () => {\n  await FirebaseMessaging.removeAllDeliveredNotifications();\n};\n\nconst subscribeToTopic = async () => {\n  await FirebaseMessaging.subscribeToTopic({ topic: 'news' });\n};\n\nconst unsubscribeFromTopic = async () => {\n  await FirebaseMessaging.unsubscribeFromTopic({ topic: 'news' });\n};\n\nconst addTokenReceivedListener = async () => {\n  await FirebaseMessaging.addListener('tokenReceived', event => {\n    console.log('tokenReceived', { event });\n  });\n};\n\nconst addNotificationReceivedListener = async () => {\n  await FirebaseMessaging.addListener('notificationReceived', event => {\n    console.log('notificationReceived', { event });\n  });\n};\n\nconst addNotificationActionPerformedListener = async () => {\n  await FirebaseMessaging.addListener('notificationActionPerformed', event => {\n    console.log('notificationActionPerformed', { event });\n  });\n};\n\nconst removeAllListeners = async () => {\n  await FirebaseMessaging.removeAllListeners();\n};\n```\n\n## API\n\n<docgen-index>\n\n* [`checkPermissions()`](#checkpermissions)\n* [`requestPermissions()`](#requestpermissions)\n* [`isSupported()`](#issupported)\n* [`getToken(...)`](#gettoken)\n* [`deleteToken()`](#deletetoken)\n* [`getDeliveredNotifications()`](#getdeliverednotifications)\n* [`removeDeliveredNotifications(...)`](#removedeliverednotifications)\n* [`removeAllDeliveredNotifications()`](#removealldeliverednotifications)\n* [`subscribeToTopic(...)`](#subscribetotopic)\n* [`unsubscribeFromTopic(...)`](#unsubscribefromtopic)\n* [`createChannel(...)`](#createchannel)\n* [`deleteChannel(...)`](#deletechannel)\n* [`listChannels()`](#listchannels)\n* [`addListener('tokenReceived', ...)`](#addlistenertokenreceived-)\n* [`addListener('notificationReceived', ...)`](#addlistenernotificationreceived-)\n* [`addListener('notificationActionPerformed', ...)`](#addlistenernotificationactionperformed-)\n* [`removeAllListeners()`](#removealllisteners)\n* [Interfaces](#interfaces)\n* [Type Aliases](#type-aliases)\n* [Enums](#enums)\n\n</docgen-index>\n\n<docgen-api>\n<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->\n\n### checkPermissions()\n\n```typescript\ncheckPermissions() => Promise<PermissionStatus>\n```\n\nCheck permission to receive push notifications.\n\nOn **Android**, this method only needs to be called on Android 13+.\n\n**Returns:** <code>Promise&lt;<a href=\"#permissionstatus\">PermissionStatus</a>&gt;</code>\n\n**Since:** 0.2.2\n\n--------------------\n\n\n### requestPermissions()\n\n```typescript\nrequestPermissions() => Promise<PermissionStatus>\n```\n\nRequest permission to receive push notifications.\n\nOn **Android**, this method only needs to be called on Android 13+.\n\n**Returns:** <code>Promise&lt;<a href=\"#permissionstatus\">PermissionStatus</a>&gt;</code>\n\n**Since:** 0.2.2\n\n--------------------\n\n\n### isSupported()\n\n```typescript\nisSupported() => Promise<IsSupportedResult>\n```\n\nChecks if all required APIs exist.\n\nAlways returns `true` on Android and iOS.\n\n**Returns:** <code>Promise&lt;<a href=\"#issupportedresult\">IsSupportedResult</a>&gt;</code>\n\n**Since:** 0.3.1\n\n--------------------\n\n\n### getToken(...)\n\n```typescript\ngetToken(options?: GetTokenOptions | undefined) => Promise<GetTokenResult>\n```\n\nRegister the app to receive push notifications.\nReturns a FCM token that can be used to send push messages to that Messaging instance.\n\nThis method also re-enables FCM auto-init.\n\n| Param         | Type                                                        |\n| ------------- | ----------------------------------------------------------- |\n| **`options`** | <code><a href=\"#gettokenoptions\">GetTokenOptions</a></code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#gettokenresult\">GetTokenResult</a>&gt;</code>\n\n**Since:** 0.2.2\n\n--------------------\n\n\n### deleteToken()\n\n```typescript\ndeleteToken() => Promise<void>\n```\n\nDelete the FCM token and unregister the app to stop receiving push notifications.\nCan be called, for example, when a user signs out.\n\n**Since:** 0.2.2\n\n--------------------\n\n\n### getDeliveredNotifications()\n\n```typescript\ngetDeliveredNotifications() => Promise<GetDeliveredNotificationsResult>\n```\n\nGet a list of notifications that are visible on the notifications screen.\n\nNote: This will return all delivered notifications, including local notifications, and not just FCM notifications.\n\nOn Android, the data field of the FCM notification will NOT be included.\n\n**Returns:** <code>Promise&lt;<a href=\"#getdeliverednotificationsresult\">GetDeliveredNotificationsResult</a>&gt;</code>\n\n**Since:** 0.2.2\n\n--------------------\n\n\n### removeDeliveredNotifications(...)\n\n```typescript\nremoveDeliveredNotifications(options: RemoveDeliveredNotificationsOptions) => Promise<void>\n```\n\nRemove specific notifications from the notifications screen.\n\n| Param         | Type                                                                                                |\n| ------------- | --------------------------------------------------------------------------------------------------- |\n| **`options`** | <code><a href=\"#removedeliverednotificationsoptions\">RemoveDeliveredNotificationsOptions</a></code> |\n\n**Since:** 0.2.2\n\n--------------------\n\n\n### removeAllDeliveredNotifications()\n\n```typescript\nremoveAllDeliveredNotifications() => Promise<void>\n```\n\nRemove all notifications from the notifications screen.\n\nNote: This will remove all delivered notifications, including local notifications, and not just FCM notifications.\n\n**Since:** 0.2.2\n\n--------------------\n\n\n### subscribeToTopic(...)\n\n```typescript\nsubscribeToTopic(options: SubscribeToTopicOptions) => Promise<void>\n```\n\nSubscribes to topic in the background.\n\nOnly available for Android and iOS.\n\n| Param         | Type                                                                        |\n| ------------- | --------------------------------------------------------------------------- |\n| **`options`** | <code><a href=\"#subscribetotopicoptions\">SubscribeToTopicOptions</a></code> |\n\n**Since:** 0.2.2\n\n--------------------\n\n\n### unsubscribeFromTopic(...)\n\n```typescript\nunsubscribeFromTopic(options: UnsubscribeFromTopicOptions) => Promise<void>\n```\n\nUnsubscribes from topic in the background.\n\nOnly available for Android and iOS.\n\n| Param         | Type                                                                                |\n| ------------- | ----------------------------------------------------------------------------------- |\n| **`options`** | <code><a href=\"#unsubscribefromtopicoptions\">UnsubscribeFromTopicOptions</a></code> |\n\n**Since:** 0.2.2\n\n--------------------\n\n\n### createChannel(...)\n\n```typescript\ncreateChannel(options: CreateChannelOptions) => Promise<void>\n```\n\nCreate a notification channel.\n\nOnly available for Android (SDK 26+).\n\n| Param         | Type                                        |\n| ------------- | ------------------------------------------- |\n| **`options`** | <code><a href=\"#channel\">Channel</a></code> |\n\n**Since:** 1.4.0\n\n--------------------\n\n\n### deleteChannel(...)\n\n```typescript\ndeleteChannel(options: DeleteChannelOptions) => Promise<void>\n```\n\nDelete a notification channel.\n\nOnly available for Android (SDK 26+).\n\n| Param         | Type                                                                  |\n| ------------- | --------------------------------------------------------------------- |\n| **`options`** | <code><a href=\"#deletechanneloptions\">DeleteChannelOptions</a></code> |\n\n**Since:** 1.4.0\n\n--------------------\n\n\n### listChannels()\n\n```typescript\nlistChannels() => Promise<ListChannelsResult>\n```\n\nList the available notification channels.\n\nOnly available for Android (SDK 26+).\n\n**Returns:** <code>Promise&lt;<a href=\"#listchannelsresult\">ListChannelsResult</a>&gt;</code>\n\n**Since:** 1.4.0\n\n--------------------\n\n\n### addListener('tokenReceived', ...)\n\n```typescript\naddListener(eventName: 'tokenReceived', listenerFunc: TokenReceivedListener) => Promise<PluginListenerHandle>\n```\n\nCalled when a new FCM token is received.\n\nOnly available for Android and iOS.\n\n| Param              | Type                                                                    |\n| ------------------ | ----------------------------------------------------------------------- |\n| **`eventName`**    | <code>'tokenReceived'</code>                                            |\n| **`listenerFunc`** | <code><a href=\"#tokenreceivedlistener\">TokenReceivedListener</a></code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#pluginlistenerhandle\">PluginListenerHandle</a>&gt;</code>\n\n**Since:** 0.2.2\n\n--------------------\n\n\n### addListener('notificationReceived', ...)\n\n```typescript\naddListener(eventName: 'notificationReceived', listenerFunc: NotificationReceivedListener) => Promise<PluginListenerHandle>\n```\n\nCalled when a new push notification is received.\n\nOn **Android**, this listener is called for every push notification if the app is in the _foreground_.\nIf the app is in the _background_, then this listener is only called on data push notifications.\nSee https://firebase.google.com/docs/cloud-messaging/android/receive#handling_messages for more information.\n\nOn **iOS**, this listener is called for every push notification if the app is in the _foreground_.\nIf the app is in the _background_, then this listener is only called for silent push notifications (messages with the `content-available` key).\nSee https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/PayloadKeyReference.html for more information.\n\n| Param              | Type                                                                                  |\n| ------------------ | ------------------------------------------------------------------------------------- |\n| **`eventName`**    | <code>'notificationReceived'</code>                                                   |\n| **`listenerFunc`** | <code><a href=\"#notificationreceivedlistener\">NotificationReceivedListener</a></code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#pluginlistenerhandle\">PluginListenerHandle</a>&gt;</code>\n\n**Since:** 0.2.2\n\n--------------------\n\n\n### addListener('notificationActionPerformed', ...)\n\n```typescript\naddListener(eventName: 'notificationActionPerformed', listenerFunc: NotificationActionPerformedListener) => Promise<PluginListenerHandle>\n```\n\nCalled when a new push notification action is performed.\n\nOnly available for Android and iOS.\n\n| Param              | Type                                                                                                |\n| ------------------ | --------------------------------------------------------------------------------------------------- |\n| **`eventName`**    | <code>'notificationActionPerformed'</code>                                                          |\n| **`listenerFunc`** | <code><a href=\"#notificationactionperformedlistener\">NotificationActionPerformedListener</a></code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#pluginlistenerhandle\">PluginListenerHandle</a>&gt;</code>\n\n**Since:** 0.2.2\n\n--------------------\n\n\n### removeAllListeners()\n\n```typescript\nremoveAllListeners() => Promise<void>\n```\n\nRemove all listeners for this plugin.\n\n**Since:** 0.2.2\n\n--------------------\n\n\n### Interfaces\n\n\n#### PermissionStatus\n\n| Prop          | Type                                                        | Since |\n| ------------- | ----------------------------------------------------------- | ----- |\n| **`receive`** | <code><a href=\"#permissionstate\">PermissionState</a></code> | 0.2.2 |\n\n\n#### IsSupportedResult\n\n| Prop              | Type                 | Since |\n| ----------------- | -------------------- | ----- |\n| **`isSupported`** | <code>boolean</code> | 0.3.1 |\n\n\n#### GetTokenResult\n\n| Prop        | Type                | Since |\n| ----------- | ------------------- | ----- |\n| **`token`** | <code>string</code> | 0.2.2 |\n\n\n#### GetTokenOptions\n\n| Prop                            | Type                                   | Description                                                                                                                                                                                                |\n| ------------------------------- | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **`vapidKey`**                  | <code>string</code>                    | Your VAPID public key, which is required to retrieve the current registration token on the web. Only available for Web.                                                                                    |\n| **`serviceWorkerRegistration`** | <code>ServiceWorkerRegistration</code> | The service worker registration for receiving push messaging. If the registration is not provided explicitly, you need to have a `firebase-messaging-sw.js` at your root location. Only available for Web. |\n\n\n#### GetDeliveredNotificationsResult\n\n| Prop                | Type                        | Since |\n| ------------------- | --------------------------- | ----- |\n| **`notifications`** | <code>Notification[]</code> | 0.2.2 |\n\n\n#### Notification\n\n| Prop              | Type                 | Description                                                                                                     | Since |\n| ----------------- | -------------------- | --------------------------------------------------------------------------------------------------------------- | ----- |\n| **`body`**        | <code>string</code>  | The notification payload.                                                                                       | 0.2.2 |\n| **`clickAction`** | <code>string</code>  | The action to be performed on the user opening the notification. Only available for Android.                    | 0.2.2 |\n| **`data`**        | <code>unknown</code> | Any additional data that was included in the push notification payload.                                         | 0.2.2 |\n| **`id`**          | <code>string</code>  | The notification identifier.                                                                                    | 0.2.2 |\n| **`image`**       | <code>string</code>  | The URL of an image that is downloaded on the device and displayed in the notification. Only available for Web. | 0.2.2 |\n| **`link`**        | <code>string</code>  | Deep link from the notification. Only available for Android.                                                    | 0.2.2 |\n| **`subtitle`**    | <code>string</code>  | The notification subtitle. Only available for iOS.                                                              | 0.2.2 |\n| **`tag`**         | <code>string</code>  | The notification string identifier. Only available for Android.                                                 | 0.4.0 |\n| **`title`**       | <code>string</code>  | The notification title.                                                                                         | 0.2.2 |\n\n\n#### RemoveDeliveredNotificationsOptions\n\n| Prop                | Type                        | Since |\n| ------------------- | --------------------------- | ----- |\n| **`notifications`** | <code>Notification[]</code> | 0.4.0 |\n\n\n#### SubscribeToTopicOptions\n\n| Prop        | Type                | Description                         | Since |\n| ----------- | ------------------- | ----------------------------------- | ----- |\n| **`topic`** | <code>string</code> | The name of the topic to subscribe. | 0.2.2 |\n\n\n#### UnsubscribeFromTopicOptions\n\n| Prop        | Type                | Description                                | Since |\n| ----------- | ------------------- | ------------------------------------------ | ----- |\n| **`topic`** | <code>string</code> | The name of the topic to unsubscribe from. | 0.2.2 |\n\n\n#### Channel\n\n| Prop              | Type                                              | Description                                                                                                                                                                                                                                                | Since |\n| ----------------- | ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |\n| **`description`** | <code>string</code>                               | The description of this channel (presented to the user).                                                                                                                                                                                                   | 1.4.0 |\n| **`id`**          | <code>string</code>                               | The channel identifier.                                                                                                                                                                                                                                    | 1.4.0 |\n| **`importance`**  | <code><a href=\"#importance\">Importance</a></code> | The level of interruption for notifications posted to this channel.                                                                                                                                                                                        | 1.4.0 |\n| **`lightColor`**  | <code>string</code>                               | The light color for notifications posted to this channel. Only supported if lights are enabled on this channel and the device supports it. Supported color formats are `#RRGGBB` and `#RRGGBBAA`.                                                          | 1.4.0 |\n| **`lights`**      | <code>boolean</code>                              | Whether notifications posted to this channel should display notification lights, on devices that support it.                                                                                                                                               | 1.4.0 |\n| **`name`**        | <code>string</code>                               | The name of this channel (presented to the user).                                                                                                                                                                                                          | 1.4.0 |\n| **`sound`**       | <code>string</code>                               | The sound that should be played for notifications posted to this channel. Notification channels with an importance of at least `3` should have a sound. The file name of a sound file should be specified relative to the android app `res/raw` directory. | 1.4.0 |\n| **`vibration`**   | <code>boolean</code>                              | Whether notifications posted to this channel should vibrate.                                                                                                                                                                                               | 1.4.0 |\n| **`visibility`**  | <code><a href=\"#visibility\">Visibility</a></code> | The visibility of notifications posted to this channel. This setting is for whether notifications posted to this channel appear on the lockscreen or not, and if so, whether they appear in a redacted form.                                               | 1.4.0 |\n\n\n#### DeleteChannelOptions\n\n| Prop     | Type                | Description             | Since |\n| -------- | ------------------- | ----------------------- | ----- |\n| **`id`** | <code>string</code> | The channel identifier. | 1.4.0 |\n\n\n#### ListChannelsResult\n\n| Prop           | Type                   |\n| -------------- | ---------------------- |\n| **`channels`** | <code>Channel[]</code> |\n\n\n#### PluginListenerHandle\n\n| Prop         | Type                                      |\n| ------------ | ----------------------------------------- |\n| **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |\n\n\n#### TokenReceivedEvent\n\n| Prop        | Type                | Since |\n| ----------- | ------------------- | ----- |\n| **`token`** | <code>string</code> | 0.2.2 |\n\n\n#### NotificationReceivedEvent\n\n| Prop               | Type                                                  | Since |\n| ------------------ | ----------------------------------------------------- | ----- |\n| **`notification`** | <code><a href=\"#notification\">Notification</a></code> | 0.2.2 |\n\n\n#### NotificationActionPerformedEvent\n\n| Prop               | Type                                                  | Description                                                      | Since |\n| ------------------ | ----------------------------------------------------- | ---------------------------------------------------------------- | ----- |\n| **`actionId`**     | <code>string</code>                                   | The action performed on the notification.                        | 0.2.2 |\n| **`inputValue`**   | <code>string</code>                                   | Text entered on the notification action. Only available for iOS. | 0.2.2 |\n| **`notification`** | <code><a href=\"#notification\">Notification</a></code> | The notification in which the action was performed.              | 0.2.2 |\n\n\n### Type Aliases\n\n\n#### PermissionState\n\n<code>'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'</code>\n\n\n#### CreateChannelOptions\n\n<code><a href=\"#channel\">Channel</a></code>\n\n\n#### TokenReceivedListener\n\nCallback to receive the token received event.\n\n<code>(event: <a href=\"#tokenreceivedevent\">TokenReceivedEvent</a>): void</code>\n\n\n#### NotificationReceivedListener\n\nCallback to receive the notification received event.\n\n<code>(event: <a href=\"#notificationreceivedevent\">NotificationReceivedEvent</a>): void</code>\n\n\n#### NotificationActionPerformedListener\n\nCallback to receive the notification action performed event.\n\n<code>(event: <a href=\"#notificationactionperformedevent\">NotificationActionPerformedEvent</a>): void</code>\n\n\n### Enums\n\n\n#### Importance\n\n| Members       | Value          | Since |\n| ------------- | -------------- | ----- |\n| **`Min`**     | <code>1</code> | 1.4.0 |\n| **`Low`**     | <code>2</code> | 1.4.0 |\n| **`Default`** | <code>3</code> | 1.4.0 |\n| **`High`**    | <code>4</code> | 1.4.0 |\n| **`Max`**     | <code>5</code> | 1.4.0 |\n\n\n#### Visibility\n\n| Members       | Value           | Since |\n| ------------- | --------------- | ----- |\n| **`Secret`**  | <code>-1</code> | 1.4.0 |\n| **`Private`** | <code>0</code>  | 1.4.0 |\n| **`Public`**  | <code>1</code>  | 1.4.0 |\n\n</docgen-api>\n\n## Changelog\n\nSee [CHANGELOG.md](https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/messaging/CHANGELOG.md).\n\n## License\n\nSee [LICENSE](https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/messaging/LICENSE).\n\n[^1]: This project is not affiliated with, endorsed by, sponsored by, or approved by Google LLC or any of their affiliates or subsidiaries.\n","readmeFilename":"README.md"}