This question already has answers here:
How to send device to device messages using Firebase Cloud Messaging?
(14 answers)
Closed 6 years ago.
I am developing a chat app using firebase real-time database. I am able to exchange messages but i want to have a message alert notification for new messages.
Sending notifications using firebase console is working but now i want to automate it without firebase console.
Do i need to create my own app server for push notification between android clients? Or is there another way to achieve this instead of creating a server?
Thank you
Firebase realtime database is very useful precisely for its "realtime" aspect.
You could create a Service that listens for changes in the database and create a Notification whenever the client receives a new message.
Related
This question already has answers here:
Is there a way to delete push notification data message sent by FCM?
(2 answers)
is there a way to remove or recall a push notification sent by fcm
(1 answer)
How to Delete already sent Remote push notification with firebase in iOS?
(3 answers)
Closed 4 months ago.
We are using firebase in a web project where have .net as our backend, and we send push notifications using firebase cloud messaging to our users' android and IOS devices.
When sending notifications to firebase and the user device is offline, the notifications can't be delivered and the notification status will be pending according to firebase documentation.
I want to know if there is a way we can cancel these pending notifications and stop them midway to the user's devices.
This question already has answers here:
How to send one to one message using Firebase Messaging
(5 answers)
How can I send a Firebase Cloud Messaging notification without use the Firebase Console?
(17 answers)
Closed 2 years ago.
This might be a duplicate questions, but still. I have seen many tutorials on sending notifications from Firebase Cloud Messaging to an android app, but I don't understand how to send notifications from my angular website to firebase, which will then push these notifications to android app. In all these tutorials, they have sent notifications by manually typing messages in the firebase UI.
My question how do I send notification data from my angular website to FCM, which will then send these notifications to my android app? Any references for this? Any procedure to follow?
In your case, you might consider having your own app server that will provide an API for your angular app to send notification. Here's a documentation on how you can send a notification to a device from your server.
https://firebase.google.com/docs/cloud-messaging/send-message
There are different parts of this implementation actually. First, your app server needs to provide an API to the Android app that will be used to send the firebase registration token from your app when the app is launched. You might consider storing those registration tokens in your backend database.
Then the other API that your server will provide, to send notification, can be integrated in your angular app. The server API should be able to find the exact registration token of the device where you need to send the notification and will call the API from FCM to send the notification to the device. Here's the API doc that you might consider taking a look into.
https://firebase.google.com/docs/cloud-messaging/http-server-ref
Here is a good tutorial that shows how you can implement the server side implementation to send the notification.
https://www.pluralsight.com/guides/push-notifications-with-firebase-cloud-messaging
This question already has answers here:
How to send device to device messages using Firebase Cloud Messaging?
(14 answers)
Closed 4 years ago.
How do I send notification from an android device to another device through firebase cloud messaging?
I do not want to use the administrative panel of firebase for sending notifications, I just want to send from one device to the other.
FCM doesn't provide device to device communication, you will have to achieve through App Server or use FCM endpoint to send messages.
Do you have App Server implemented? which sends notification through FCM.
Approach 1:
If App Server is there then you can follow: https://firebase.google.com/docs/cloud-messaging/android/upstream and add logic in App Server to send notification.
Approach 2:
You could use Firebase Remote Config to share FCM server keys, and make Http request from android client.
This question already has answers here:
How do you send a Firebase Notification to all devices via CURL?
(10 answers)
Closed 3 years ago.
I would like to send data messages to all users.
Is it possible to do it programmatically, without using the Firebase Notifications Console?
The problem with the Console is that the "message text" field at the beginning of the form is compulsory. So, even if I add the custom data key/values, there will also be the standard notification component.
As stated here, when the message includes both notification and data, in case the app is in the background, a standard notification message will be notified to the system tray.
I would like instead to deliver only a notification based on the custom data (trigged by OnMessageReceived).
How can I achieve that? Programmatically, I can correctly send data messages to specific users, but I cannot find a way to send data messages to ALL users.
Use topic messaging. You can define the name of a topic that all installations of your app will subscribe to, then send the message to that topic.
You can use the Firebase Admin SDK from your server to send that message. Or you can use the FCM HTTP API to send that message.
This question already has answers here:
How to send Device to device notification by using FCM without using XMPP or any other script.?
(3 answers)
Closed 5 years ago.
I want so send push notification directly using firebase. I don't wanna use any server!
Is it possible? To send Firebase push notification Android to Android Directly using FirebasePlease Help!
sir firebase is also a server so if you want to send notificaion to every user device or individual device use firebase or use another services like php
without server is not possible