FCM
Provides basic functionality for Firebase Cloud Messaging
Stuck on a Cordova issue?

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic's experts offer official maintenance, support, and integration help.
Installation
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
Supported Platforms
- Android
- iOS
Usage
import { FCM } from '@ionic-native/fcm/ngx';
constructor(private fcm: FCM) {}
...
this.fcm.subscribeToTopic('marketing');
this.fcm.getToken().then(token => {
backend.registerToken(token);
});
this.fcm.onNotification().subscribe(data => {
if(data.wasTapped){
console.log("Received in background");
} else {
console.log("Received in foreground");
};
});
this.fcm.onTokenRefresh().subscribe(token => {
backend.registerToken(token);
});
this.fcm.unsubscribeFromTopic('marketing');