Does firebase handle push notifications?
Asked Answered
G

6

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?

Glaikit answered 1/8, 2014 at 11:10 Comment(7)
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.Snobbish
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 and notify whichever technology you're talking to.Rumba
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.Glaikit
So i would need a separate server running a process which monitors firebase for changes and notify the relevant users?Glaikit
@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. zapier.com/zapbook/pushover/firebase. Basically Zapier would listen for changes to your Firebase data and automatically send the data to Pushover.Wigley
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.Glaikit
Good questions. I'd like to emphasize that the scenario mentioned in the question is initiated by a data change. FCM - Firebase Cloud Messaging only handles messages initiated by the Firebase console.Recalescence
C
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

Calabrese answered 31/10, 2014 at 13:23 Comment(8)
Thanks. I went with parse and so far so good. Only issue is with intermittent 503 unavailable errors. Not filling with with confidence.Glaikit
parse is really unstable we have faced lot of production issues.Histolysis
Parse will be deactivated :(Publish
Hello, Isn't Firebase supports listening for data changes on specific location? 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?Unknow
@Unknow 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.Straiten
still unclear there is not told in documentation where device id is added in firebase ..Limacine
@Calabrese - Have you seen some documentation, how to send Firebase Push Notifications without firebase GUI console? REST API or Server SDK...?Nawrocki
@asletron - documentation on server send api: firebase.google.com/docs/cloud-messaging/server#http-requestTaper
P
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:

Pupil answered 18/5, 2016 at 19:6 Comment(2)
@TannerHallman - Have you seen some documentation, how to send Firebase Push Notifications without firebase GUI console? REST API or Server SDK...?Nawrocki
@Nawrocki Can you pls help with the exact link for the doc?Aggiornamento
D
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.

Deuteron answered 1/8, 2014 at 15:36 Comment(4)
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 :)Observe
Oh, also, as of the Summer of 2015 Google can handle push notifications to both Apple and Android platforms.Observe
Parse is dead, so I hope firebase will support push notification like parse does.Dielectric
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??Limacine
M
6

Batch.com is offering a Push Notification service for Firebase

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

Methinks answered 5/2, 2016 at 11:30 Comment(2)
how does it send push notification because i can't find device idLimacine
i need to provide a device id so then only i can send push notificationLimacine
I
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.

Isador answered 20/5, 2016 at 1:44 Comment(0)
A
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

Alessandro answered 10/10, 2017 at 20:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.