How to send push notification Firebase direct from app by code [closed] - android

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to send a push notification when an event happens in my app, without using the Firebase console for this.
Can I send a request by json to the server? And if so, how? Because I have difficulties in this part.
Thank you

You can send upstream messages from your app to Firebase Cloud Messaging. But you will need your own app server to respond to those messages. I recommend reading the documentation on the role of these servers.
Since you cannot send direct device-to-device messages with Firebase Cloud Messaging, an alternative for some developers is to use the Firebase Database for keeping a queue of the messages. You'll still need an app server to read that queue and send the downstream messages to the devices, but at least you won't have to learn XMPP.

Related

Why do we need a push notification provider with FCM [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I am completely new to the whole concept of push notifications. I have written a back-end server and I will send push notifications from it to the Android app, which is also written by me. But my question is:
Do I really need, or why would I need a Push notification service?
Thanks!
If you want to use FCM to send push notifications, at some point in time, someone has to make a request to Google's FCM service, because Google is the only one, who can send a message to a device via FCM. Same applies for APNS, at some point in time, someone has to make a request to Apple's APNS service
Depending on your requirements, you can do this yourself in your own code or you can use some 3rd party provider. Using a 3rd party provider MAY have benefits. For instance they may take care of token management, or provide a single request for sending to Android and iOS devices, and so on and so forth. But in the end of the day, also a 3rd party provider sends out requests to Google or Apple in your behalf.
You can use firebase cloud messaging service or using socket programming for this .

Push firebase notification to one client [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have an android application with firebase and i want to send a notification to a specific client from another client .
"cloud messaging" allows me to send a notification to every client has the application.
Firebase Cloud Messaging also allows you to send a notification to a single client, as long as you know the FCM token of that client. For example see the section on sending a message to a token using the Composer in the Firebase console, and sending a message to an individual device using the Admin SDK, and sending a message to an individual device using the HTTP REST API.
But FCM does not allow directly sending notification from once client to another. You will always needs to send the downstream messages from a trusted environment, such as the Composer in the Firebase console, your development machine, a server you control, or Cloud Functions.For more on this, see:
How to send one to one message using Firebase Messaging
How to send device to device messages using Firebase Cloud Messaging?
Diego's answer here
probably many more of these search results

Can we Demonstrate Upstream Messaging with help of only FCM and without Xmpp? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I want to demonstrate Upstream Messaging using FCM. If Firebase have their own cloud database and worked as backend server then why should we use XMPP?
Not possible. You need the App Server to work with Upstream Messaging.
The FCM server works only as a middle man in the flow for both Downstream and Upstream messaging (as I mentioned here). Like so, for upstream messaging:
Client App -> FCM Server -> App Server
Without your App Server, where would the FCM server forward the data that you need to process?
You could think of the FCM server as the part that handles the queuing of the messages between the two points.

Can i use firebase cloud messaging to create an android chat application to be used at large scale [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am a beginner in android application development,therefore i dont know the cons of firebase cloud messaging.So,can i use fcm for chat application which can handle multiple users at a time
FCM can be a valid part of a chat application, but it will only be one piece of the puzzle. You also need a server component for a complete solution.
Two advantages of FCM over other approaches for messaging:
No need to create an additional connection for the most part (battery, data, & performance advantage) if you use XMPP as your protocol for upstream and downstream messaging. An XMPP FCM client will reuse the device's single persistent connection to FCM servers.
Ability to have (high-priority) messages trigger a notification even in Doze mode to ensure instant user notification.
There are alternative technologies available that you might consider, but for a beginner in Android development FCM may be one of the better approaches if you know your way around a server.

Best way to implement a messaging system [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have got a client-server android app and i want to integrate a small
messaging tool where users can send messages to other users. It does not
need to be like a real time chat, it would be enough to act asynchronous
like email messaging for example.
I just need to know whats the 'best practice' for such a messaging service
for storing the messages. Is it smart to save all the messages and message
history in the database or should they be stored as files on the harddrive
on server side?
Is it enough to save them at the server and load them into the app everytime
the users opens the messaging activity or would it be better to synchronize
the messages? Or shouldnt i store the messages on the server at all and keep the
history on the device itself?
The answer is 'depends'. Do you expect a lot of messages? If so, synchronizing is probably better than downloading all the messages.
Do you want users to see messages on another device if they switch devices? If so, you have to store the messages on the server.
Also, do you want users to be notified of a message when they're not using the app? Or when another user sends them the message, and not when they start the app? That would require using push notifications.
So - depends.
The best practise would be mainly to use GCM for notifying devices about new messages, which requires a server anyway. Once you have a server, it's better to have database to be sure you won't lose any messages.

Categories

Resources