Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to implement push notifications with Firebase

I am an iPhone app coder, and I'm using Firebase as my backend server. Firebase doesn't support Push Notifications, so I've been trying to figure out how to include them in my app. I've read this question: How to send an alert message to a special online user with firebase but it seems like more of a work-around than an actual solution.

Is there an answer on how to do this? Are there third parties or APIs that might seemlessly implement this functionality?

One solution I have tried is to use Zapier to connect Firebase to Pushover.

At this point, I've been able to observe events in the app that I'm coding and then get notifications in a pushover app on my iphone. However, ideally, I'd like to receive the notifications in my app, not in the pushover app, because I don't want users to need to have pushover in order to use my app and because I want users to receive their own distinct notifications, not notifications for everyone.

Does anyone have suggestions on how I should handle this issue?

Thanks for the help!

EDIT This isn't a duplicate of this question: Does firebase handle push notifications? because I know Firebase doesn't directly handle push notifications. I'm looking for the best indirect way of handling push notifications with Firebase.

like image 301
Philip Sopher Avatar asked Jan 07 '16 16:01

Philip Sopher


People also ask

Is Firebase good for push notifications?

Firebase Cloud Messaging (FCM) provides a reliable and battery-efficient connection between your server and devices that allows you to deliver and receive messages and notifications on iOS, Android, and the web at no cost.

How does Firebase integrate with push notifications on a website?

Open the Cloud Messaging tab of the Firebase console Settings pane and scroll to the Web configuration section. In the Web Push certificates tab, find and select the link text, "import an existing key pair."

How does Firebase push notification work internally?

The FCM backend receives the message request, generates a message ID and other metadata, and sends it to the platform specific transport layer. When the device is online, the message is sent via the platform-specific transport layer to the device. On the device, the client app receives the message or notification.


2 Answers

Now 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.

like image 117
JúlioCézar Avatar answered Sep 21 '22 16:09

JúlioCézar


If you want device to device push messages and not just server to device, the only solution I found was OneSignal. I was able to add basic device to device push message support for my app in about an hour and it is currently free.

Both Batch and Firebase only support server to device push messages, not what you want for a chat app

like image 32
n6xej Avatar answered Sep 23 '22 16:09

n6xej