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
54
votes
13 answers

Send push to Android by C# using FCM (Firebase Cloud Messaging)

I am using this code to send notification message by C# with GCM, using Winforms, Webforms, whatever. Now I want to send to FCM (Firebase Cloud Messaging). Should I update my code? : public class AndroidGCMPushNotification { public…
Teste
  • 661
  • 1
  • 6
  • 7
52
votes
5 answers

Firebase (FCM) registration token in Flutter

I am trying to send notification from Java Rest Api (using Firebase Admin sdk) to my Flutter application and it seems it requires device token to send notification and I cannot find how to get that token. I am new to Flutter and android and may be…
ajay datla
  • 703
  • 1
  • 5
  • 12
52
votes
3 answers

Firebase: How to set default notification channel in Android app?

How to set default notification channel for notification messages that come when an app is in the background? By default, these messages use "Miscellaneous" channel.
52
votes
6 answers

com.google.android.gms.common.internal.safe parcel.safe parcelable not found

I am trying to add notification services to my app using FCM and tutorial given on https://www.simplifiedcoding.net/firebase-cloud-messaging-android/ Everything has done and working like getting token etc. but now after creating messaging handler, I…
Panache
  • 1,701
  • 3
  • 19
  • 33
50
votes
8 answers

How to configure Firebase Messaging with latest version in Flutter?

I was using the below line of code for firebase messaging configuration for flutter noticification configuration , but now after integrating to the latest version of the firebase messaging it is giving me error CODE LINE …
user14707939
50
votes
6 answers

Firebase Messaging on Android suddenly started crashing when message received

Currently using react native, react-native-firebase, and react-native-push-notification. Everything was fine until suddenly today firebase messaging started causing the app to crash. The error message is the following: Process: com.packagename,…
50
votes
5 answers

Firebase: change the location of the service worker

I am trying to use Firebase messaging (web). Firebase by default searches for the file "firebase-messaging-sw.js" which holds the service worker. The service worker script is expected to be on the absolute path of the application! For example :…
Dewan159
  • 2,984
  • 7
  • 39
  • 43
50
votes
15 answers

Correct way to retrieve token for FCM - iOS 10 Swift 3

i had implement Firebase with FirebaseAuth/FCM etc and did sent notification successfully through Firebase Console. However i would need to push the notification from my own app server. i am wondering below which way is correct way to retrieve the…
aznelite89
  • 2,025
  • 4
  • 21
  • 32
49
votes
4 answers

Firebase InstanceID.instanceID().token() method is deprecated

I am working with swift and firebase. Previously I was using following method to get firebase token which then I was using to store into database to send notifications. InstanceID.instanceID().token() Now this method is showing as deprecated since…
Deepak
  • 1,030
  • 2
  • 10
  • 21
48
votes
5 answers

Requested entity was not found when trying to send a push notification using Firebase Cloud Messaging in Firebase Cloud Functions

I'm trying to send a multicast notification via FCM from a Firebase Cloud function with the following code: const message = { tokens: recipients, notification: { title: title, body: body }, data: { …
Sebastien
  • 3,583
  • 4
  • 43
  • 82
48
votes
6 answers

Firebase silent apns notification

Is there a way to send a silent APNS using google's firebase? It seems that if the app is in the background it will always show a notification to the user. Thanks?
46
votes
2 answers

How to address android lint complaint about exported Firebase Messaging service implementations?

Following the Google developer instructions on implementing Firebase in my app, I notice that android lint complains. The idea is that we have to implement two services which inherit from Firebase services: public class MyFirebaseInstanceIDService…
46
votes
1 answer

Firebase Cloud Messaging last collapse_key not received (rate limited?)

I have a service that uses Firebase Cloud Messaging to communicate with its Android clients using FCM Data messages with the collapse_key parameter set. From the documentation about collapsable keys: When there is a newer message that renders an…
dacwe
  • 43,066
  • 12
  • 116
  • 140
45
votes
4 answers

Firebase token error TOO_MANY_REGISTRATIONS

After reading 100's of threads and googling I am still confused about this following error message. Currently, I am using Firebase Cloud Messaging and in very short terms I am trying to get my token from Firebase to be able to send messages to my…
45
votes
2 answers

ANR error "Broadcast of Intent { act=com.google.firebase.INSTANCE_ID_EVENT" ... "FirebaseInstanceIdInternalReceiver" for Android 7.1 and 8.0

We have an Android app that have many ANR errors reported lately. This only occurs on Android 7.1 and 8.0 (not on e.g. 4.4, 5.0 or 6.0). The ANR is: Broadcast of Intent { act=com.google.firebase.INSTANCE_ID_EVENT flg=0x14…