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
70
votes
14 answers

Error: fix the version conflict (google-services plugin)

As per this SO thread, I know there are version conflicts, but issue still persists after new versions from Google. Error:Execution failed for task ':app:processDebugGoogleServices'. Please fix the version conflict either by updating the version…
67
votes
4 answers

When does a FCM token expire?

When do FCM tokens expire? Is it at 6 months?
66
votes
4 answers

Is GCM (now FCM) free for any limit?

I would like to know if Firebase Cloud Messaging is free or not for unlimited users?
65
votes
2 answers

Could not find com.google.gms:google-services:4.0.1

Hi i started a new project in android and imported firebase as told in google docs. Everything was perfect in Android studio 3.0.1. Now i update my Android studio to 3.2.1. Now the same code is rebuild and got error that Could not find…
64
votes
6 answers

Firebase (FCM): open activity and pass data on notification click. android

There should be clear implementation of how to work with Firebase notification and data. I read many answers but can't seem to make it work. here are my steps: 1.) I am passing notification and data to android in PHP and it seems to be fine: $msg =…
62
votes
3 answers

In what period does the firebase's app token changes and how to manage it?

I am new to firebase I am learning it like a toddler learning to walk. So far I have managed to send a message to my own phone using a token generated for my phone by firebase framework. Now here's where it gets tricky (in my opinion). There is a…
roostaamir
  • 1,928
  • 5
  • 24
  • 51
60
votes
13 answers

Sending Push via Postman using Firebase Messaging

I'm trying to use Postman to send a single Push Notification using Firebase Cloud Messaging service. This is a working cURL command for the same purposal, on which I'm using as a reference. curl -X POST --header "Authorization: key="…
Machado
  • 14,105
  • 13
  • 56
  • 97
58
votes
8 answers

Firebase message with high priority not waking device from Doze android 6+

I have migrated my project from using GCM to use Firebase. Push notification comes through ok when the device is awake or been asleep recently but if I leave the device for say an hour, no push is sent until I wakeup the device. The Android docs say…
turtleboy
  • 8,210
  • 27
  • 100
  • 199
57
votes
4 answers

What is the maximum length of an FCM registration ID token?

Working with the "new" Firebase Cloud Messaging, I would like to reliably save client device registration_id tokens to the local server database so that the server software can send them push notifications. What is the smallest size of database…
jamesc
  • 5,852
  • 3
  • 32
  • 42
56
votes
6 answers

Firebase Cloud Messaging - How to validate Tokens?

I am using Firebase Cloud Messaging (FCM) and as per the abreviated code below everytime a new Token is generated on the Customer Device... I send this new TOKEN to my SERVER DB (Cloud) where I save it in order to be able to send future Push…
Geo305
  • 1,084
  • 2
  • 10
  • 16
56
votes
8 answers

Firebase: Cannot upload production APNs certificate

I am currently testing an app in TestFlight and need a production APNs certificate in order to test Notifications in Firebase. I have followed all of the steps in this video and successfully configured the development APNs…
56
votes
10 answers

Convert Map to Bundle in android

Is there an easy way to convert a Map to a Bundle in android without explicit iteration? Why? Firebase returns a Map for Notification getData(). I need to pass the data to an intent. Formerly GCM gave me a bundle, so I didn't need to worry about…
Nouvel Travay
  • 6,292
  • 13
  • 40
  • 65
55
votes
5 answers

What Bearer token should I be using for Firebase Cloud Messaging testing?

I am trying to send a test notification using Firebase Cloud Messaging via Postman. I'm doing a POST to this url https://fcm.googleapis.com/v1/projects/[my project name]/messages:send The Authorization tab in Postman is set to No Auth and my…
sonicblis
  • 2,926
  • 7
  • 30
  • 48
54
votes
4 answers

FCM with Postman - The request was missing an Authentication Key (FCM Token)

//body its like this { "to": "/topics/NEWS" , "data":{ "extra_information": "This is some extra information" }, //notification that i need to give "notification":{ "title": "ChitChat Group", …
HemalHerath
  • 1,006
  • 2
  • 18
  • 38
54
votes
4 answers

Get all subscribed topics from firebase cloud messaging

Using the new FirebaseMessaging it's easy to un/subscribe to topics via: FirebaseMessaging.getInstance().subscribeToTopic(); FirebaseMessaging.getInstance().unsubscribeFromTopic(); But is there any way to get all topics the current installation is…
Andre Classen
  • 3,868
  • 3
  • 26
  • 36