Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Quickstart Android | 8,489 | a day ago | 42 | apache-2.0 | Java | |||||
Firebase Quickstart Samples for Android | ||||||||||
Timy Messenger | 1,910 | 5 months ago | 21 | apache-2.0 | Dart | |||||
Timy - open source mobile app for groups to communicate and organize themselves. Built with flutter. | ||||||||||
Chat Sdk Android | 1,575 | 24 days ago | 9 | other | Java | |||||
Chat SDK Android - Open Source Mobile Messenger | ||||||||||
Chat Sdk Ios | 886 | 5 | 24 days ago | 109 | May 15, 2022 | 44 | other | Objective-C | ||
Chat SDK iOS - Open Source Mobile Messenger | ||||||||||
Emberfire | 691 | 2,144 | 18 | 6 months ago | 70 | October 17, 2019 | 45 | mit | TypeScript | |
The officially supported adapter for using Firebase with Ember | ||||||||||
Messenger Ios Chat Swift Firestore | 563 | 7 months ago | 13 | mit | Swift | |||||
Messenger Clone - Real-time iOS Chat with Firebase Firestore written in Swift | ||||||||||
Messenger | 555 | a year ago | 2 | apache-2.0 | Swift | |||||
iOS - Real-time messaging app 🎨 | ||||||||||
Actingweb_firstapp | 392 | 22 days ago | 4 | other | Dart | |||||
Starter app for Flutter that includes many different production app features; some not typically included in demo apps. | ||||||||||
Fcm | 355 | 10 days ago | 18 | November 22, 2022 | 6 | mit | PHP | |||
Firebase Cloud Messaging (FCM) notifications channel for Laravel | ||||||||||
Fcm Toolbox | 304 | 10 hours ago | 1 | apache-2.0 | Kotlin | |||||
📲 Firebase Cloud Messaging toolbox |
@capacitor-community/fcm
Capacitor community plugin for enabling FCM capabilities
![]() |
Intenseloop |
Maintainer | GitHub | Social |
---|---|---|
Stewan Silva | stewones | @stewones |
We're starting fresh under an official org. If you were using the previous npm package capacitor-fcm
, please update your package.json to @capacitor-community/fcm
. Check out changelog for more info.
Using npm:
npm install @capacitor-community/fcm
Using yarn:
yarn add @capacitor-community/fcm
Sync native files:
npx cap sync
Notice
This plugin is intended to be used combined with Capacitor API for Push Notifications. Capacitor only provides APN token whereas this plugin offers the possibility to work with FCM tokens and more.
method | info | platform |
---|---|---|
subscribeTo |
subscribe to fcm topic | ios/android |
unsubscribeFrom |
unsubscribe from fcm topic | ios/android |
getToken |
get fcm token to eventually use from a server | ios/android |
refreshToken |
refresh fcm token to get a new one | ios/android |
deleteInstance |
remove local fcm instance completely | ios/android |
setAutoInit |
enable the auto initialization of the library | ios/android |
isAutoInitEnabled |
check whether auto initialization is enabled | ios/android |
import { FCM } from "@capacitor-community/fcm";
import { PushNotifications } from "@capacitor/push-notifications";
// external required step
// register for push
await PushNotifications.requestPermissions();
await PushNotifications.register();
// now you can subscribe to a specific topic
FCM.subscribeTo({ topic: "test" })
.then((r) => alert(`subscribed to topic`))
.catch((err) => console.log(err));
// Unsubscribe from a specific topic
FCM.unsubscribeFrom({ topic: "test" })
.then(() => alert(`unsubscribed from topic`))
.catch((err) => console.log(err));
// Get FCM token instead the APN one returned by Capacitor
FCM.getToken()
.then((r) => alert(`Token ${r.token}`))
.catch((err) => console.log(err));
// Delete the old FCM token and get a new one
FCM.refrehToken()
.then((r) => alert(`Token ${r.token}`))
.catch((err) => console.log(err));
// Remove FCM instance
FCM.deleteInstance()
.then(() => alert(`Token deleted`))
.catch((err) => console.log(err));
// Enable the auto initialization of the library
FCM.setAutoInit({ enabled: true }).then(() => alert(`Auto init enabled`));
// Check the auto initialization status
FCM.isAutoInitEnabled().then((r) => {
console.log("Auto init is " + (r.enabled ? "enabled" : "disabled"));
});
Navigate to the project settings page for your app on Firebase.
Download the GoogleService-Info.plist
file. In Xcode right-click on the yellow folder named "App" and select the Add files to "App"
.
Tip: if you drag and drop your file to this location, Xcode may not be able to find it.
Download the google-services.json
file and copy it to android/app/
directory of your capacitor project.
brew install cocoapods
(once a time)
ionic start my-cap-app --capacitor
cd my-cap-app
mkdir www && touch www/index.html
npx cap add ios
npm install --save @capacitor-community/fcm
npx cap sync ios
(always do sync after a plugin install)
npx cap open ios
GoogleService-Info.plist
to the app folder in xcode// (optional) turn off `swizzling` in the `info.plist`
<key>FirebaseAppDelegateProxyEnabled</key>
<string>NO</string>
Tip: every time you change a native code you may need to clean up the cache (Product > Clean build folder) and then run the app again.
If you need to implement opt-in behavior, you can disable the auto initialization of the library by following the Firebase docs.
ionic start my-cap-app --capacitor
cd my-cap-app
mkdir www && touch www/index.html
npx cap add android
npm install --save @capacitor-community/fcm
npx cap sync android
(always do sync after a plugin install)
npx cap open android
google-services.json
to your android/app
folderNow you should be set to go. Try to run your client using ionic cap run android --livereload
.
Tip: every time you change a native code you may need to clean up the cache (Build > Clean Project | Build > Rebuild Project) and then run the app again.
This plugin will use the following project variables (defined in your app's variables.gradle
file):
$firebaseMessagingVersion
version of com.google.firebase:firebase-messaging
(default: 23.1.2
)If you need to implement opt-in behavior, you can disable the auto initialization of the library by following the Firebase docs.
MIT
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!