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
4
votes
1 answer

Swift How to change the notification title and body received from firebase (FCM) before fire it up by the system?

How can I change the title and the body for the received firebase notification before fire it up by the system? I received the notification successfully but I need to modify the title and the body before the show the notification this is my…
4
votes
2 answers

Firebase Admin SDK: Not fetching access token

The goal is to make my express server send a push notification using Firebase Cloud Messaging (FCM). The problem is that the initialization of the admin SDK does not seem to work. Code is written in JavaScript, node version is 10.16.0,…
4
votes
1 answer

Unsubscribe all users from a topic in FCM

Is there a way to unsubscribe all users from a topic in Firebase Cloud messaging without knowing the tokens? Basically, "delete" the topic? It would be really really painful to do this manually since it should happen with a document change trigger,…
4
votes
1 answer

Difference between topic messaging and device token cloud function push notification?

In Firebase cloud function can send push notification to any user if the user device token is stored in Firebase database. Again if the user subscribes to a topic then also another user can send a notification to the user. Now the question is that…
4
votes
1 answer

Sending push notification on firestore document field change

I have a Flutter app that lets users rent items from eachother with Firestore RTDB. In my rental document, I have a field status that determines the status of the rental (think of it like shipping an item, where items can have status of 'ordered',…
4
votes
0 answers

Show modal notifications in React Native when app is background or killed. Similar to Whatsapp Call notification

I'm trying to implement notifications in React-Native app. My notifications are pretty similar to WhatsApp call. No matter the app is open or closed, your phone is locked or not, it shows the notification that someone is calling. I searched about it…
4
votes
1 answer

Display default notification in onMessageReceived

I'm using Firebase Cloud Messaging for Android. When my app is in the foreground, FCM will invoke onMessageReceived on my app's FirebaseMessagingService subclass. When my app is in the background, the Android OS will create a default notification…
Dan Fabulich
  • 37,506
  • 41
  • 139
  • 175
4
votes
2 answers

How to prevent FCM from converting nested json objects to string in Data Message notifications in react-native

I'm using firebase in my react-native project (with typescript), I set up all thing correctly and it works fine with data messages like below: { "to": "fcm-token", "data": { "field1": "value1", "field2": "value1", "field3":…
4
votes
2 answers

Does firebase provide any form of test tokens?

I'm currently doing server side development for firebase. I'd like to test that my sendMessage function is working by targeting a test token. I tried using testToken as a value, but arbitrary values will in fact return an error: Error: The…
Seph Reed
  • 8,797
  • 11
  • 60
  • 125
4
votes
4 answers

How to send a firebase message to topic from Android

I want to send a message to FCM topics from within my Android app. Sending the message through the Firebase console is working well, but once a user executes a particular action, I want a message to be sent to all other users who have subscribed to…
DeKekem
  • 589
  • 10
  • 20
4
votes
3 answers

Android FirebaseMessaging Service onMessageReceived called twice

I have implemented firebase cloud messaging in my Android app. When I send notification from backed or Firebase console onMessageReceived() is triggered twice and generates two notifications on device. I've tried to search on internet but no results…
4
votes
1 answer

Android App is shutting down when I send a push notification form a Ruby on Rails backend with FCM

I'm trying to send push notification messages using the FCM gem to a android phone. I'm able to get the device token and I think I set everything up the way it should. Only when I use my ruby back-end to send a test message I get the following…
Frank
  • 174
  • 10
4
votes
0 answers

Firebase clod messaging in flutter : open specific route when clicking on a notification (get a context)

I'm using firebase_messaging to get push notifications on the app .. I'm sending with the notification a route to display a specific page when clicking on the notification with the help of flutter_local_notification like this: (I've not a good…
4
votes
3 answers

How to properly receive Intent Extras on xamarin

At the moment I'm using this tutorial for xamarin push notifications. It's working like a charm. My goal now is to handle the intents properly. In my firebase messaging service, I create a notification and Put extras. private void…
Phoenix
  • 467
  • 4
  • 18
4
votes
0 answers

Not Receiving "custom push Notification" when app is in background in android devices on Oreo and above devices

I am working chat application. I want to show custom push Notification when message receives, when app is open and closed (not destroyed or killed) notification are received, below code is working fine, but when app is killed or destroyed from…