Questions tagged [firebase-cloud-messaging]

Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits the reliable and scalable GCM infrastructure, plus new features. It is a cross-platform solution that let user reliably deliver and receive messages and notifications at no cost. It supports Android, iOS, Desktop Web Browsers, the Mobile web with JavaScript or WebPush and Internet-of-Things (IoT) devices.

About Firebase Cloud Messaging

Firebase Cloud Messaging is a component of the Firebase suite of tools for cross-platform application development.

  • Send unlimited upstream/downstream messages
  • Send messages to individual devices or a user segment
  • Handle all aspects of queueing and delivery
  • Optimize for battery efficiency

Using FCM, you can notify a client app that new email or other data is available to sync. You can send notifications to drive user reengagement and retention. For use cases such as instant messaging, a message can transfer a payload of up to 4KB to a client app.

How does it work?

An FCM implementation includes an app server in your environment that interacts with FCM via HTTP or XMPP protocol, and a client app. Additionally, FCM includes the Notifications console, which you can use to send notifications to client apps.

Firebase Notifications is built on Firebase Cloud Messaging and shares the same FCM SDK for client development. For testing or for sending marketing or engagement messages with powerful built-in targeting and analytics, you can use Notifications. For deployments with more complex messaging requirements, FCM is the right choice.

Related tags

12555 questions
21
votes
3 answers

How to unregister phone from firebase cloud messaging

Hello I am developing an test app using FCM I go through docs and also search on net but unable to find the option that how can a device token can be deleted from firebase database. I have tried Firebase.getInstanceId.deleteToken but It didn't help…
Pritish Joshi
  • 2,025
  • 3
  • 18
  • 33
21
votes
1 answer

How to delete a topic from Firebase Console? (FCM)

Does anyone know how to delete a client topic from the Firebase Console?
20
votes
3 answers

Firebase Messaging v1 401 Project Not Permitted error

I am running a node server with the firebase admin sdk. However, everytime I try to send a push notification from the server, I get a 401 error. Here's the exact error I'm getting: errorInfo: { code: 'messaging/authentication-error', message: 'An…
Tlal
  • 591
  • 1
  • 6
  • 14
20
votes
5 answers

How to use process.env in a React service worker

I am trying to set-up a Firebase-messaging-sw.js file (for web push notifications). I am wondering if there is a way to avoid exposing my Firebase config data to the public as much as possible - though it might be revealed anyways? (I'm not too sure…
20
votes
3 answers

How to implement Firebase Cloud Messaging (FCM) with Nuxt.js

I'm trying to implement Google's Firebase Cloud Messaging (FCM) into my Nuxt.js APP. So far I've installed firebase, created a firebase.js plugin inside ./plugins folder, imported and initialized firebase and the messaging service, everything seems…
20
votes
5 answers

Flutter: Foreground notification is not working in firebase messaging

I need to show firebase notifications when the app is on foreground by using local notification but it is not working. FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin=new FlutterLocalNotificationsPlugin(); static …
20
votes
5 answers

Custom sound push notification does not work (Flutter)

{ "to": "XXXX", "notification": { "title": "ASAP Alert", "body": "Please open your app" }, "data": { "screen": "/Nexpage1", "sound": "alarm", "click_action": "FLUTTER_NOTIFICATION_CLICK" } } Above is my payload for the…
ali
  • 859
  • 4
  • 12
  • 25
20
votes
1 answer

Firebase Cloud Messaging + Android: Priority of silent notifications

TLDR: Messages send to Android devices via FCM take between 10 seconds and 5 minutes to get delivered. Probably due to priority. I set it to "high", but it seems like it doesn't stay on that value. I develop an app both for iOS and Android. My…
J. Hesters
  • 13,117
  • 31
  • 133
  • 249
20
votes
2 answers

FCM rich push notification payload for iOS

I am using FCM for my project. It's have rich push notification for a type. I tried to modified most of possible ways to get push from FCM. I got obly ordinary push from FCM, not with image. I am also check with APNS same coding using push try. I…
20
votes
5 answers

How to handle launch options in Swift 3 when a notification is tapped? Getting syntax problems

I am trying to handle the launch option and open a specific view controller upon tapping a remote notification that I receive in swift 3. I have seen similar question, for instance here, but nothing for the new swift 3 implementation. I saw a…
TheBen
  • 3,410
  • 3
  • 26
  • 51
20
votes
3 answers

Negation in condition while sending FCM message

I am subscribing to a topic which is my application version in Android. FirebaseMessaging.getInstance().subscribeToTopic(APP_VERSION); Now every time I launch an update, I have to unsubscribe to an old version and subscribe to a new version so if I…
mihirjoshi
  • 12,161
  • 7
  • 47
  • 78
20
votes
4 answers

Firebase console: How to specify click_action for notifications

I implemented Firebase and testing the Firebase notifications. When the app is in the foreground I don't have problems, I implemented a service that extends FirebaseMessagingService and handle the message and data in onMessageReceived I have…
Alex
  • 1,447
  • 7
  • 23
  • 48
19
votes
4 answers

Firebase messaging doesn't have a default constructor

import 'package:flutter/material.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; class PushNotificationService { final FirebaseMessaging firebaseMessaging =…
Franklin Premkumar
  • 189
  • 1
  • 1
  • 6
19
votes
4 answers

Flutter Firebase Messaging is Unable to create service io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService

I am trying to use Firebase Messaging in a Flutter app. I follow all the instruction from the package. In my pubspec.yaml I have these packages: dependencies: flutter: sdk: flutter ... firebase_messaging: ^5.1.5 ... My main.app is just…
Hamilton
  • 379
  • 1
  • 3
  • 8
19
votes
7 answers

Firebase Notification is grey flutter

I'm using Firebase Cloud Messaging to send notifications to my Flutter app. It works fine but my app icon notification is grey on the Google Pixel XL. I can see the outline, but for some reason, it's still grey. I've read in different articles that…