2

Is there any possibility to implement GCM with Firebase Server...?
if it is then how we can do it.?
Example i have a chat application in which the back-end server is firebase only no other services and also the authentication system of firebase is implemented then how we send the notification to specific user to notify that there is some msgs from other users.

Moosa Baloch
  • 1,175
  • 1
  • 13
  • 25
  • 1
    Answer below. But after writing it, I realized this has been asked multiple times before: http://stackoverflow.com/questions/25078953/does-firebase-handle-push-notifications, http://stackoverflow.com/questions/29142564/how-to-handle-push-notification-in-firebase and http://stackoverflow.com/questions/28686138/firebase-push-notifications-node-worker (although for iOS/APN, the approach will be similar for Android/GCM). – Frank van Puffelen Dec 27 '15 at 15:31

2 Answers2

4

From the landing page of Google Cloud Messaging:

Google Cloud Messaging (GCM) is a free service that enables developers to send messages between servers and client apps. This includes downstream messages from servers to client apps, and upstream messages from client apps to servers.

Firebase is a back-end as a service that provides a set of APIs that your application can talk to. There is currently no Firebase API to send push notifications to clients.

Firebase currently doesn't allow running your code on their servers.

This means that you will need to run code on a server of your own to send the messages through GCM.

Typically developers using Firebase have their (Android or other) apps push the notification information to a location in Firebase, where a server-side script then reads the information from and calls Google Cloud Messaging. This type of queue based approach is quite common with Firebase and is covered as pattern 2 in this article about Firebase application architectures.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Thanks for your reply sir. I have a question that are you going to cover application architecture pattern in your upcoming video tutorials on udacity ? – Moosa Baloch Dec 27 '15 at 15:45
  • Interesting idea. The course is finished, but I'll ask what Lyla and the team have in mind going forward. – Frank van Puffelen Feb 18 '16 at 20:19
  • 1
    Actually, as of today (May 19 2016) Google just rebranded GCM to Firebase Cloud Messaging and it offers this feature. See this response for a more complete answer: http://stackoverflow.com/a/37336674/3032209 – Yair Kukielka May 20 '16 at 15:56
  • Yup, was just going to say what @YairKukielka. Is there an outdated flag? – RyPope May 20 '16 at 19:14
2

Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits the reliable and scalable GCM infrastructure, plus new features! See the FAQ to learn more. If you are integrating messaging in a new app, start with FCM. GCM users are strongly recommended to upgrade to FCM, in order to benefit from new FCM features today and in the future.

[Source: https://developers.google.com/cloud-messaging/topic-messaging#sending_topic_messages_from_the_server - 18 May 2016]

So the answer now is yes, and you can follow this link (and the previous one) to have more information on how you can do it.

Daniele D.
  • 2,624
  • 3
  • 36
  • 42
  • Here https://firebase.google.com/docs/cloud-messaging/downstream how to send downstream messages. On the same page, left menu, how to send also upstream, to topic, to devices. – Daniele D. May 28 '16 at 10:39