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
30
votes
4 answers

FCM Notification in iOS doesn't play sound when received

I am using Firebase push notifications in my iOS Application. Although I am able to send the notification by sending below payload, it doesn't play a sound when received. { "to": "myToken", "notification": { "body": "test", …
30
votes
1 answer

API key for GCM is suddenly invalid? Unauthorized (401) error

I created an Android API key for GCM Push Notification for my Android application.From the last two days, GCM server returns Unauthorized (401) response in PHP. Is there any reason for Android API key invalid/expire? Or Is Android API key…
29
votes
2 answers

Java.Lang.NoClassDefFoundError when implementing firebase cloud messaging

I am implementing push notifications using Firebase Cloud Messaging, for this I added this code in my AndroidManifest.xml file
29
votes
2 answers

How to check the delivery status of Firebase message sent to an Android application?

I am testing the Firebase JSON to check the delivery receipts of the notification sent to the news app. I can successfully send the message to the Android app without any issues and I receive the message on my Android app. However, I want to know…
29
votes
5 answers

Get value from RemoteMessage from FCM onMessageReceived method

I have migrate gcm to fcm for push notification message. but how I Get bundle data from RemoteMessage received onMesssageReceived method. Old GCM give bundle data onMessageReceiced method but in FCM there is RemoteMessage data. So please tell me…
29
votes
7 answers

No static method zzUr() in Firebase when I try to use Analytics with Notifications

I'm starting to use the Firebase Cloud Messaging. I have only the example code of the guide to use the Notifications and Analytics. If I don't install Analytics notifications works fine, but when I add in gradle the Analytics I have get this error…
S.P.
  • 2,274
  • 4
  • 26
  • 57
28
votes
6 answers

An error occurred when trying to authenticate to the FCM servers

An error occurred when trying to authenticate to the FCM servers. Make sure the credential used to authenticate this SDK has the proper permissions. See https://firebase.google.com/docs/admin/setup for setup instructions enter image description here
UA DEV
  • 391
  • 1
  • 3
  • 8
28
votes
3 answers

Where to save GoogleService-Info.plist in Flutter without Xcode?

I have my app already submited, reviewed and online in Google Play & iTunes, but recently I added the firebase_messaging plugin for notification feature. While joining the Firebase Cloud Messaging, Google forced me to download two files:…
Linesofcode
  • 5,327
  • 13
  • 62
  • 116
28
votes
2 answers

Can i use firebase cloud messaging without notification permission? (Javascript)

Update: Google Bug Report Description (as suggested by google dev advocate in comments on answer 1, filed a bug report; updating the content here since it more succinctly and precisely describes the problem) I do not need or want to show any…
user2297550
  • 3,142
  • 3
  • 28
  • 39
28
votes
6 answers

Push notifications in Apple Safari with FCM

We implemented push notifications using FCM in chrome and firefox and it worked fine, but Safari doesn't support Service Workers which is mandatory for FCM. Did anyone deal with this kind of issues? any suggestions?
28
votes
6 answers

firebase cloud messaging: setBackgroundMessageHandler not called

I am prototyping browser push notifications with FCM. I just copied the example code from the quickstart (https://github.com/firebase/quickstart-js/tree/master/messaging). Messages are recieved and displayed as they should be. But when I try to…
Mathias
  • 1,076
  • 1
  • 9
  • 10
28
votes
10 answers

Clicking on notification doesn't open mentioned activity

I am trying to open an Activity when the notification is clicked and below is my code. Intent intent = new Intent(this.getApplicationContext(),…
27
votes
1 answer

Firebase Cloud Messaging - Target to single device not visible in Firebase console

I am trying to send notification to a single device in android , but when i am doing it from Firebase console , it's not visible in Firebase new view . Could anyone help me from where do i need to send notification to a single device ?
27
votes
1 answer

Send notification to only one user in firebase

I have an android app and I want to send notifications to only one user when data is change. How can I do that? I don't want to send my message to all users of my app, just the user whose data changed. Since Firebase returns a unique registration…
Atif Rizwan
  • 645
  • 2
  • 8
  • 17
27
votes
5 answers

Send push notifications using Cloud Functions for Firebase

I am trying to make a cloud function that sends a push notification to a given user. The user makes some changes and the data is added/updated under a node in firebase database (The node represents an user id). Here i want to trigger a function that…