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
0 answers

Capacitor PushNotifications registration and registrationError not firing in first App Launch on iOS

I implemented push notifications using Firebase FCM, Ionic V4 and Capacitor. I built the app for both Android and iOS. Everything is working fine, I'm able to get and handle push notifications, except for when the iOS app is first launched after…
Multitut
  • 2,089
  • 7
  • 39
  • 63
4
votes
1 answer

How to test FCM push notification to a device via a token ID

According to the documentation, I need to do the following: ... Open the Notifications composer and select New notification. Enter the message text. Select Send test message. In the field labeled Add an FCM registration token, enter the…
BVB09
  • 805
  • 9
  • 19
4
votes
2 answers

Flutter FCM getToken() returns null

FCM getToken() always returns null on real devices, but is working just fine on emulator, I don't know what causes this. Here's how I use getToken(): FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); String fcmToken = ""; await…
Aldy Yuan
  • 1,795
  • 9
  • 23
4
votes
1 answer

ReferenceError: process is not defined at firebase-messaging-sw.js

I need to use .env file in the firebase-messaging-sw.js located at public folder in the ReactJs. The .env file is located in project root folder and I need to use it in the firebase-messaging-sw.js without moving .env to another location. but When…
4
votes
1 answer

FCM: firebase getToken options( ServiceWorkerRegistration, vapidKey)

So this is how the firebase docs describe the get token function: getToken ( options ? : { serviceWorkerRegistration ?: ServiceWorkerRegistration ; vapidKey ?: string } ) : Promise < string > Optional options: { serviceWorkerRegistration?:…
4
votes
1 answer

What error codes do members of MessagingErrorCode correspond to?

This is regarding a migration from Firebase client version 6 to 7. In the past, we called .getException().getErrorCode() on an instance of com.google.firebase.messaging.SendResponse. We handled two cases specifically,…
Markus Appel
  • 3,138
  • 1
  • 17
  • 46
4
votes
5 answers

java.lang.RuntimeException: Unable to instantiate service com.samriddh.partner.java.MyFirebaseMessagingService

I am using Firebase messaging and when I got notification from firebase console my application shutdown with this exception can anyone please suggest me what should I have to do i am fighting with this issue for more than 2 hours now My firebase…
Keshav Suman
  • 75
  • 2
  • 6
4
votes
1 answer

How to get FCM token?

I am trying to get FCM token in react js application. First thing i tried is to use messaging.useServiceWorker(registration) then use messaging.getToken() and it's working fine on localhost for firefox and google chrome, but on an HTTPS live server…
4
votes
2 answers

flutter: FCM count number of notifications

I'm trying to create notification badge inside application (in home screen) on this code and I'm using Firebase Cloud Messaging with android app in flutter language, problem is I can't figure out how to count the number of received notification…
user13125672
4
votes
1 answer

Firebase Cloud Messaging (FCM) getToken() without requesting browser permission

I am trying to push some data messages to my clients from my cloud functions. These are not really notifications rather they are client specific confidential data that I need to push to the appropriate client. I do not want to show a notification…
4
votes
2 answers

How to request notification permission again on web through flutter

I have integrated notifications for flutter web, its working fine when i give permission for the first time, but lets say user has denied it so is there any way to request notifications permission again to get token in dart files from javascript…
4
votes
2 answers

How to implement Push Notification in Xamarin with Firebase and Apple Push Notification with C# backend

During my migration from Native Android and iOS to Xamarin.Forms, I had decided to use AppCenter Push for my notification, since it is free and easy to use (of course I spent a good amount of time to make it works since it's relatively new thing…
4
votes
0 answers

Firebase push notification custom sound is not working

I have created a tool to test firebase push notifications of my project and I have added a custom sound for the notifications. Custom sound is working properly on IOS but in android some devices play the default sound instead of custom one. Below I…
4
votes
0 answers

I want to Send FCM notification using python

i want to send fcm notification to topic using just python from pyfcm import FCMNotification API_KEY = "AAAA...Gzzjo" push_service = FCMNotification(api_key=API_KEY) data = {'notification': {'title': 'Test','body': 'first test'} ,…
4
votes
1 answer

Show FCM notification thoughout the app when the app is open (Flutter)

I'm using FCM to send push notifications to my device right now and it's working perfectly. However when the app is open, I only get the onResume to be executed when I'm in that particular page. I want to display the notification on the top…
That Guy
  • 224
  • 2
  • 12