Firebase Cloud Messaging: notification one-to-one [duplicate] - android

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.

Related

Sending notifications from angular website to android app [duplicate]

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

Android - Firebase Cloud Messaging Device to Device Push Notification Without Server [duplicate]

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.
Is there a way to send push notification between 2 android devices without a server?
I found some tutorials but all of them was using the node.js for sending a notification. (Or I found that some samples that were using the firebase console for doing this)
Nope,
You need a "server" to do push notification. You can use a variety of services to do that, as you mentioned firebase is one of them. You may not need a full on server, but you need some kind of service to do that, you can't simply send notifications between devices straight away:
Some examples are:
AWS Serverless functions
Cloud functions in firebase
If you'd rather use one of these services, then you'll need to configure FCM in your app, you can check how to do that in the docs. And some nice sample codes here :)

Sending Push Notification Directly [duplicate]

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

Firebase for chat message alert (push notification) [duplicate]

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.

Firebase: How to observe a node and send push notifications to clients? [duplicate]

This question already has answers here:
Firebase chat Push Notifications
(4 answers)
Closed 6 years ago.
Since the new release of Firebase you are able to send push notifications from the console to specified clients with Firebase Notifications. But for a chat app I need Firebase to watch a node for new children and send the push notifications to those clients.
Is Firebase capable of this and if yes what is the best way to do this?
With Firebase client sdk you can register listeners for node events on the client side. Then Firebase will do the magic to notify the client on node events.

Categories

Resources