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
562
votes
31 answers
323
votes
31 answers

Firebase onMessageReceived not called when app in background

I'm working with Firebase and testing sending notifications to my app from my server while the app is in the background. The notification is sent successfully, it even appears on the notification centre of the device, but when the notification…
Cyogenos
  • 3,509
  • 3
  • 15
  • 14
291
votes
19 answers

FirebaseInstanceIdService is deprecated

Hope all of you aware of this class, used to get notification token whenever firebase notification token got refreshed we get the refreshed token from this class, From following method. @Override public void onTokenRefresh() { // Get updated…
Uttam Panchasara
  • 5,735
  • 5
  • 25
  • 41
256
votes
17 answers

How can I send a Firebase Cloud Messaging notification without use the Firebase Console?

I'm starting with the new Google service for the notifications, Firebase Cloud Messaging. Thanks to this code https://github.com/firebase/quickstart-android/tree/master/messaging I was able to send notifications from my Firebase User Console to my…
David Corral
  • 4,085
  • 3
  • 26
  • 34
255
votes
21 answers

Android Push Notifications: Icon not displaying in notification, white square shown instead

My app generates a notification, but the icon I set for that notification is not being displayed. Instead, I get a white square. I have tried resizing the png of the icon (dimensions 720x720, 66x66, 44x44, 22x22). Curiously, when using smaller…
218
votes
13 answers

GCM with PHP (Google Cloud Messaging)

Update: GCM is deprecated, use FCM How can I integrate the new Google Cloud Messaging in a PHP backend?
194
votes
10 answers

Firebase messaging, where to get Server Key?

Firebase allows us to send notification messages via our own application by making POST request. This tutorial, gives to us instructions how to make this request. However, there is Authorization field in header where I must to place my own Server…
Mr.D
  • 7,353
  • 13
  • 60
  • 119
192
votes
12 answers

Where can I find the API KEY for Firebase Cloud Messaging?

I am trying to figure out how the new version of GCM or Firebase Cloud Messaging works so I moved one of my projects to the new Firebase console, If I did not have the API KEY or I want to create a new one... where can I do it?
Nissar
  • 2,360
  • 2
  • 13
  • 12
162
votes
10 answers

Notification Icon with the new Firebase Cloud Messaging system

Yesterday Google presented at Google I/O the new notification system based on the new Firebase. I tried this new FCM ( Firebase Cloud Messaging ) with the example on Github. The icon of the notification is always the ic_launcher despite I have…
143
votes
27 answers

Firebase (FCM) how to get token

It's my first time using FCM. I download a sample from firebase/quickstart-android and I install the FCM Quickstart. But I can't get any token from the log even hit the LOG TOKEN button in the app. Then I try to send a message with Firebase console…
wyx
  • 3,334
  • 6
  • 24
  • 44
133
votes
2 answers

What method should I use now since FirebaseInstanceId.getInstance().getToken() is deprecated

I would like to know what would be the correct way to get Firebase token for sending push notification now that getToken() is deprecated.
128
votes
33 answers

FCM getting MismatchSenderId

I have an application that uses Google FCM for sending push notifications. When i send a push notification to a group of users, i get a response of MismatchSenderId for some of them. Even though, all users have the exact same application. How can…
TareK Khoury
  • 12,721
  • 16
  • 55
  • 78
126
votes
13 answers

Firebase FCM force onTokenRefresh() to be called

I am migrating my app from GCM to FCM. When a new user installs my app, the onTokenRefresh() is automatically being called. The problem is that the user is not logged in yet (No user id). How can I trigger the onTokenRefresh() after the user is…
TareK Khoury
  • 12,721
  • 16
  • 55
  • 78
124
votes
8 answers

FATAL EXCEPTION: Firebase-Messaging-Intent-Handle -- java.lang.NoClassDefFoundError

I am not using any Firebase or Youtube code/libraries in my project. Yet recently, in Android Pre-Release Reports I am seeing crashes with this: FATAL EXCEPTION: Firebase-Messaging-Intent-Handle Process: com.google.android.youtube, PID:…
grolschie
  • 2,163
  • 2
  • 12
  • 29
121
votes
17 answers

how to open particular screen on clicking on push notification for flutter

I am trying to achieve open specific screen on clicking push notification and my payload looks like this: var payload = { notification: { title: notificationTitle, body: notificationMessage, …
siva kumar
  • 2,745
  • 6
  • 19
  • 29
1
2 3
99 100