36

I am investigating whether firebase and angularfire are a good fit for my upcoming project.

One of the requirements are for users to be notified when the app is closed on new private messages sent to user, ie. push notifications.

Does firebase handle this?

Daniele D.
  • 2,624
  • 3
  • 36
  • 42
BillyMedia
  • 1,354
  • 2
  • 16
  • 21
  • 3
    This question is rather broad, since the mechanism for sending/receiving push notifications depends on the platform that you're targeting (iOS <> Androiod <> Chrome). But in general Firebase's client libraries only operate when that client is active. So they won't receive updates when the client is inactive, but *will* receive pending updates when the client becomes active again. – Frank van Puffelen Aug 01 '14 at 12:57
  • 1
    Furthermore, "handling" push notifications at the client would be done by the app and not really involve Firebase. "Sending" them is a simple matter of [a node.js process to listen](https://gist.github.com/katowulf/bbd4f60ec9e354c03afa) and notify whichever technology you're talking to. – Kato Aug 01 '14 at 14:28
  • ah, ok. thats a bit of a show stopper. Are you aware of a way to enable push notifications when new data is pushed to firebase? Googling isnt returning much. – BillyMedia Aug 01 '14 at 14:29
  • 1
    So i would need a separate server running a process which monitors firebase for changes and notify the relevant users? – BillyMedia Aug 01 '14 at 14:30
  • 2
    @BillyKhan - check out Zapier. There's potential for Zapier to connect your Firebase data to another service called Pushover to handle push notifications to your clients. https://zapier.com/zapbook/pushover/firebase/. Basically Zapier would listen for changes to your Firebase data and automatically send the data to Pushover. – Mike Pugh Aug 01 '14 at 14:58
  • Pushover appears to be an app that receives notifications, is that correct? if so, i need the app to receive notifications when all apps are closed and not require the use of another app. – BillyMedia Aug 01 '14 at 15:07
  • http://codingaffairs.blogspot.com/2016/06/firebase-cloud-messaging-push.html – Developine Jun 20 '16 at 08:04
  • Good questions. I'd like to emphasize that the scenario mentioned in the question is initiated by a data change. [FCM - Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/) only handles messages initiated by the Firebase console. – AlikElzin-kilaka Jul 15 '16 at 20:45

6 Answers6

34

Yes. This was not the case until recently, though.

Thanks to @libik for providing relevant documentation link:

https://firebase.google.com/docs/cloud-messaging/server#http-request

Update 5/2016 :

on Google io 16 , Google announced FCM - Firebase cloud messaging service.

With the announced expansion of Firebase at Google I/O recently, we also introduced Firebase Cloud Messaging (FCM) and Firebase Notifications (FN). As a developer, there are lots of updates that you might be able to take advantage of.

see more at : https://developers.googleblog.com/2016/05/google-cloud-messaging-and-firebase.html

documentation : https://firebase.google.com/docs/cloud-messaging/#key_functions

AnhSirk Dasarp
  • 701
  • 2
  • 20
  • 38
astletron
  • 1,387
  • 1
  • 14
  • 26
  • Thanks. I went with parse and so far so good. Only issue is with intermittent 503 unavailable errors. Not filling with with confidence. – BillyMedia Oct 31 '14 at 15:04
  • parse is really unstable we have faced lot of production issues. – sarat Dec 10 '14 at 01:20
  • 6
    Parse will be deactivated :( – guilherme.minglini Jan 29 '16 at 00:24
  • Hello, Isn't Firebase supports listening for data changes on specific location? https://www.firebase.com/docs/web/api/query/on.html So, why not to have clients listening for data change, then we can use the callback to show a notification at clients? isn't that what push notifications all about? – simo Jan 31 '16 at 10:56
  • @simo Unfortunately, that is not true. Push notification is something that able to notify without having your app running actively or foreground but what you just describe is local notification which can't be done without app running. – andykkt Jan 31 '16 at 23:54
  • still unclear there is not told in documentation where device id is added in firebase .. – Aniket Tiwari Feb 19 '16 at 05:35
  • 4
    @astletron - Have you seen some documentation, how to send Firebase Push Notifications without firebase GUI console? REST API or Server SDK...? – libik May 19 '16 at 13:12
  • @asletron - documentation on server send api: https://firebase.google.com/docs/cloud-messaging/server#http-request – ThisGuy May 25 '16 at 00:56
11

As of today, the Google I/O has announced the new Firebase Cloud Messaging Service does now support sending push notifications. It integrates with Google Cloud Messaging to deliver messages upstream and downstream!

You can read more about it here:

And the Firebase Cloud Messaging reference is here:

hallmanitor
  • 318
  • 1
  • 4
  • 9
  • 1
    @TannerHallman - Have you seen some documentation, how to send Firebase Push Notifications without firebase GUI console? REST API or Server SDK...? – libik May 19 '16 at 13:17
  • @libik Can you pls help with the exact link for the doc? – Sagar Mody Jul 02 '16 at 13:51
10

firebase is a storage. You wouldn't expect storage to do any actions.

For local notification generated by app when it is in the background you can constantly listen to changes in firebase and when the change occurs you can generate your push notification. In order to save the connection time since you are charged by concurrent connections, you can go offline and go online every 5 min for 20s. During this time firebase sdk connects to server, collects all the changes and runs all callbacks. You decide within your app what to do.

If you would like to enjoy remote push notification. You would need to setup a server listening to changes on firebase and talking to APNS which will push the notification to client's device.

webduvet
  • 4,220
  • 2
  • 28
  • 39
  • 3
    Parse started out as "storage" but has continued to add features. I actually fully expected Firebase to handle push notifications as a competitor to Parse. That's what hope and expectations will get you I guess :) – Bill Mote Jan 13 '16 at 13:24
  • 2
    Oh, also, as of the Summer of 2015 Google can handle push notifications to both Apple and Android platforms. – Bill Mote Jan 13 '16 at 13:26
  • Parse is dead, so I hope firebase will support push notification like parse does. – Trần Trung Hiếu Feb 04 '16 at 01:59
  • but I have still doubt i want to send push notification to my android phone using firebase + batch but there is not mention how to add the device id to send notification?? – Aniket Tiwari Feb 19 '16 at 05:32
6

Batch.com is offering a Push Notification service for Firebase

https://batch.com/parse-replacement-with-firebase

Rachel
  • 2,858
  • 2
  • 26
  • 30
5

Actually, today (May 19, 2016) Google rebranded GCM to Firebase Cloud Messaging and it now offers this cross platform service. Firebase also offers notifications.

These are the differences between these two services:

  • Firebase Cloud Messaging provides a complete set of messaging capabilities through its client SDKs and HTTP and XMPP server protocols. For deployments with more complex messaging requirements, FCM is the right choice.
  • Firebase Notifications is a lightweight, serverless messaging solution built on Firebase Cloud Messaging. With a user-friendly graphical console and reduced coding requirements, Firebase Notifications lets users easily send messages to reengage and retain users, foster app growth, and support marketing campaigns.

If you want a more detailed comparison. Read this.

Yair Kukielka
  • 10,686
  • 1
  • 38
  • 46
1

The answer is YES!

At 2017 Firebase published Cloud function. You can use a database trigger to send a push notification (using FCM) even when the app is closed.

I have created a tutorial for firebase cloud function and Xcode(iOS) if you're interested, for the javascript it's the same code: https://www.youtube.com/watch?v=jOJdlvMS6KA

A. Inbar
  • 80
  • 14