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
108
votes
10 answers

How do you send a Firebase Notification to all devices via CURL?

I'm attempting to send out a notification to all app users (on Android), essentially duplicating what happens when a notification is sent via the Firebase admin console. Here is the CURL command I begin with: curl --insecure --header "Authorization:…
105
votes
8 answers

FCM with AWS SNS

I am using AWS resources for my android project, I am planning to add push notification service for my project with AWS SNS.there are few questions bothering me much. I did not find any questions regarding these, except one or two but with unclear…
105
votes
10 answers

No notification sound when sending notification from firebase in android

I am sending push notification from firebase to my Android Application. but when my app is in background firebase onMessageReceived method is not called instead firebase send notification to system for showing notification in system…
101
votes
12 answers

FirebaseInstanceId Token retrieval failed SERVICE_NOT_AVAILABLE

I'm working on an android app, it uses Firebase Authentication, Database and Storage. It was all working fine until this error message started to show up in logcat. (I did not tamper with any configs at firebase console) E/FirebaseInstanceId: Token…
94
votes
13 answers

Firebase Cloud Messaging - Handling logout

How do I handle situation, when user logs out of my application and I no longer want him to receive notifications to the device. I tried FirebaseInstanceId.getInstance().deleteToken(FirebaseInstanceId.getInstance().getId(),…
Michał Klimczak
  • 12,674
  • 8
  • 66
  • 99
94
votes
23 answers

Firebase cloud messaging notification not received by device

I am having an issue with FireBase Cloud Messaging in which I get the Token from the device and send the notification test through the Google Firebase notification console however, the notification is never logged nor pushed to the android virtual…
xec86
  • 1,291
  • 1
  • 11
  • 17
93
votes
4 answers

What is FCM token in Firebase?

In the new Firebase, under Notification, they have mentioned that developer can send notification to a particular device. For that, in console it asks for an FCM token. What is it exactly and how can I get that token?
85
votes
9 answers

PluginRegistry cannot be converted to FlutterEngine

As soon as I updated the flutter to version 1.12.13 I found this issue and can't fix it. I did as the firebase_messaging tutorial sent and got the following error: "error: incompatible types: PluginRegistry cannot be converted to FlutterEngine …
84
votes
7 answers

Is Firebase Cloud Messaging free?

I need to implement push notification feature in my application. Exploring some options. Google recently recommends Firebase platform, but this is not completely a free service. So I thought of using GCM again. Will google stop support for GCM in…
82
votes
16 answers

IncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM

Since I updated to Android SDK Tools 25.1.6 and Android Support Repository 32.0.0 (this morning), I got the following error, I didn't change anything in my code and it is still working on my colleague computer (Android SDK Tools 25.1.1 + Android…
80
votes
6 answers

Android app not receiving Firebase Notification when app is stopped from multi-task tray

I have read a similar question on SO, however, I was not able to get the correct answer from it. I have a system wherein we send notification to around 500 devices. Unfortunately, many of these devices are not receiving the notification. I have…
80
votes
10 answers

Firebase 401 unauthorized error FCM

I'm trying to test out Firebase Cloud messaging APIs as all functionality is not available from console (notably customization of notifications when app is in background). But for some reasons, I cannot get it to work, and it always shows up 401…
gaurav jain
  • 3,119
  • 3
  • 31
  • 48
80
votes
14 answers

How to send device to device messages using Firebase Cloud Messaging?

After searching the docs I could not find any info on how to send device to device messages using FCM without the use of an external server. For example, if I was creating a chat application I would need to send push notifications to users about…
Suyash
  • 2,531
  • 2
  • 17
  • 29
74
votes
13 answers

Firebase FCM notifications click_action payload

I am trying to open a particular activity when the user clicks the notification when the app is in the background. From the Docs, I have got that click_action has to be added in the payload and an intent filter in the App to handle it. But, how to…
73
votes
13 answers

Firebase onTokenRefresh() is not called

In my MainActivityin my log, I can see the token using FirebaseInstanceId.getInstance().getToken() and it display the generated token. But it seems like in my MyFirebaseInstanceIDService where it is extends to FirebaseInstanceIdService, the…