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
33
votes
3 answers

Firebase notifications when app is closed

I have implemented Firebase notification in my Android application. When my app is running, notification is displayed with my custom layout, but when application is not running, the notification is displayed with the default layout. How can I change…
33
votes
1 answer

What is the difference between Firebase push-notifications and FCM messages?

Heloo, I am building an app where I am using push notifications via Firebase Console. I want to know what is a difference between simply push-notification and cloud message? Is it that messages from cloud messaging are data messages(have key and…
33
votes
10 answers

Android: Firebase token is null at first run

I am using FCM to provide notifications in my app. Everything worked well, but now I realised that, when I install my application using Android Studio (not from GooglePlay) the token is null at first run. When I close my app and restart it, the…
Matej Košút
  • 590
  • 2
  • 10
  • 27
32
votes
3 answers

How to specify Android notification channel for FCM push messages in Android 8

Our app now has targetSdkVersion 26 (Android 8) and the app uses FCM push notifications. As FCM documentation prescribes I updated the FCM client library to version 11.2.0: dependencies { compile…
32
votes
1 answer

Firebase Cloud Messaging - Managing Registration Tokens

I'm looking at implementing messaging between mobile and browser apps using Firebase cloud messaging and i have a few questions, that the docs don't seem to answer. For being able to receive messages, you need a Registration Token (RT). Messages…
32
votes
5 answers

Open specific Activity when notification clicked in FCM

I am working on App in which I am required to show notification. For notification, i am using FireBase Cloud Messaging (FCM). I am able to get Notification when app is in background. But when I click on notification, it redirect to home.java page.…
31
votes
8 answers

A Firebase App named "[DEFAULT]" already exists

I have my flutter App integrated with firebase, everything was fine but when I migrated firebase project to client firebase console, added his google services file, changed DefaultFirebaseOption.currentplatform file credentials but I got error…
K_Chandio
  • 558
  • 1
  • 7
  • 16
31
votes
10 answers

All firebase libraries must be either above or below 14.0.0

I have checked my app build.gradle file and these are the only lines that are related to firebase in them /*** * Firebase */ implementation 'com.google.firebase:firebase-core:15.0.0' implementation…
31
votes
5 answers

Implement Firebase inside of a Library

I want to implement Firebase notifications system inside a library that I want to use as SDK in many apps. Firebase is asking now for an App ID, but I'm implementing it inside a library, thus no App Id. How could I achieve my goal to be able to send…
31
votes
7 answers

Firebase Cloud Messaging notification from Java instead of Firebase Console

I am new to Firebase and I am running into errors such as mismatch sender id and Authentication Error with HTTP status 401 when my Java application tries to send a notification/message using the client's Firebase token. Note that using Firebase…
Sanjay Saxena
  • 365
  • 1
  • 5
  • 8
30
votes
1 answer

Flutter FCM 7 on iOS 14

For everyone who goes crazy from FCM after updating to iOS14 & Xcode12. I spent 2 days resolving the issues. On the simulator, it works but on a real device, it does not. Maybe these instructions can help someone & prevent wasting the time. Also,…
Mayvas
  • 569
  • 4
  • 16
30
votes
1 answer

Deep Link with Push Notification - FCM - Android

What I want: I want to send push notification to users. When user tap on that notification, user should navigate to specific activity. What I did: I created one deep link in Firebase console. I implemented FirebaseInstanceIdService &…
30
votes
5 answers

FCM default icon uses invalid gradient

The default FCM icon of the Android manifest is not used. Instead the Android standart icon is used. In the logcat it says: E/FirebaseMessaging: Icon with id: 2131230849 uses an invalid gradient. Using fallback icon. The default icon only…
TheRedhat
  • 473
  • 6
  • 13
30
votes
7 answers

Firebase FCM error: 'InvalidRegistration'

I am currently trying to send a PushNotification to a Device Group using FCM with the help of Firebase Cloud Functions but once the notification is sent, it returns with code 200 but with failure : SUCCESS response= { multicast_id:…
anho
  • 1,705
  • 2
  • 20
  • 38
30
votes
5 answers

How to subscribe to topics with web browser using Firebase Cloud Messaging

I'm trying to find a way to send a notification using Firebase Cloud Messaging to all of my app's users, but I have a web-only app. I've seen solutions that appear to be for Android/iOS, which basically involves having the users auto-subscribe to a…
Derek
  • 493
  • 2
  • 5
  • 9