Show notification based on a Firebase values - firebase

I want to show notification in my app even if the app is closed.. I don't need Firebase's Push Notification Service. The idea is similar to WhatsApp's message notification service.
When a value is added to firebase by a user another user should receive notification that there is a value change
Can someone tell me how this is done and What should I use to achieve this?

Push notifications for all major apps run through APNS for iOS, and Firebase Cloud Messaging for Android. While the apps may use a higher-level service from their application code, those services depend on APNS and FCM for the actual message delivery.
To see an example of how to build a notification system on top of this, based on values being written to a database, see Send Firebase Cloud Messaging notifications for new followers.

Related

React native app sending push notification while device is offline

I'm about to develop an app similar to a birthday reminder and I plan to use firebase for push notifications but what makes me second question my choice is whether users will be able to receive a birthday notification if they are offline(not connected to internet for the whole birthday day). I know firebase has some offline persistence support but I'm not sure if this includes push notifications support. Are there any options to achieve that with firebase or with any other tool compatible with react native?
If the device is not connected to the internet, it is going to be impossible to deliver messages to it through Firebase Cloud Messaging or other internet protocols.
The common way to deal with such a scenario is to deliver the message to the device when the user does have an internet connection, and then only display it once it's the right time. By sending a data-only message through FCM, your application code controls exactly what happens with the message data.
There are essentially two types of notifications: in app messaging and cloud messaging. Both are offered by Firebase: In App Messaging and FCM (Firebase Cloud Messaging).
The details you've given about your app is a little bit vague but if you're asking for push notifications, then FCM does the job. FCM will send notification when the app is on background or killed (exited out). When you say device is offline I'm assuming you mean when the user isn't using the phone. Yes, the notification will still come.
https://firebase.google.com/docs/cloud-messaging

Flutter and Firebase: Dynamic push notifications like Whatsapp

Most tutorials I've seen on the topic of notifications either broadcast notifications through the Firebase Console, or create in-app notifications that don't work if the app is in the background or is closed completely.
Is there a way to make notifications pop up dynamically using Flutter and Firebase even when the app is closed? Something like Whatsapp or Instagram notifications.
Reference image for what I mean by notifications like Whatsapp: https://www.techidence.com/wp-content/uploads/2020/10/WhatsApp-Nootifications.jpg
You won't be able to generate dynamic notifications directly from Flutter. Since to do this, the App has to be active. Usually you would send these kind of notifications from some kind of backend. Google Cloud Messaging exposes an API for this, which allows you to send POST requests to an Endpoint, and Google handles the sending of the actual notification.
Check this article under the point "1. Send Notification"
https://medium.com/#selvaganesh93/firebase-cloud-messaging-important-rest-apis-be79260022b5

How to create a "real" iOS push notification from Firebase topic messages if the app is not running?

As far as I understand messages on subscribed topics are received through the socket connection.
So while the app is running in the background I could create local notifications and "fake" notification that pop up on the home screen and are visible in the notification center.
But is there a way to receive topic pushes if the app is closed/not running in the background?
I'm grateful for any kind of feedback as I couldn't find any documentation regarding that specific use case.
Just to clarify: I am talking about (subscribed) topic messages in firebase NOT the firebase messages. I am used to the generic iOS push notifications handling and the involved lifecycle methods. All I need to know is how firebase topic messages can be sent via apns notifications.
With Firebase Messaging you can send notifications so the app is closed (it must be installed), basically it is configured in the AppDelegate the methods and configuration according to your need, you can see more information here Firebase Messaging
No you can’t, setup your configration in apo delegate and firebase settings, when the app is offline firebase talked directly to the APN which called the nitification center in your iphone but you don’t have access on it during the application is closed.

Unsubscribe Firebase Push Notifications from unknown devices

I have implemented the Firebase push notifications in my web application.
I then subscribed from multiple unknown/random devices to receive these push notifications.
How do I unsubscribe unknown devices for my push notifications?
The ability to unsubscribe the user from firebase is still missing.
Refer this firebase document for more details
To do this you will need to call unsubscribe() on a PushSubscription (from the subscribed client)
I am assuming that is not possible in your case. Thus, I would advise you to
change your Web Push certificates from the firebase console.

push notifications ionic 2 for android

I need to configure push notifications for an Ionic 2 application for android devices.
I read here that in order to do that you need to login to Firebase console, create a project and so on...
So my question is, do I really need to log into Firebase to do this? I'm not using firebase in my app, so I don´t get why I need to create a project to get a SERVER_ID and SERVER_KEY. What if I delete that project in Firebase afterwards, then my push notifications will stop working?
Thanks
Yes, you do need an account to use Firebase Cloud Messaging because you'll need a key to send pushs.
You need the key to use device-to-device push via HTTP and you need a project to send notifications to a group or topics.
I don't think that there's a way to use push without creating an account in any service.
You don't need a Firebase account.
You can use azure notifications hub or amazon aws or google cloud service, ionic cloud, etc.
Any cloud services that provides a notification hub which is basically a server for receiving and redistributing to the registered parties to the specific platforms.
Please note that some of these are specifically mobile oriented meaning you wont have to write any server side code and others aren't.

Resources