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

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 .

Related

How does Discord or Telegram send Push Notifications to channels on Android? [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
So, I'm working on a chat app and I am having trouble sending notifications using FCM to chat groups or channels.
There are 2 options I tried using:
Device groups: This is perfect but, The docs says that I can only add 20 devices to a group and that's no good as I need many more to be added.
Topic Messaging: This is also good but I wish there was a way to restrict hackers from joining to other topics and getting notifications from private messages/channels.
A third option is to store everyones device token in my database and then send each one a notification but this sounds so inefficient but I'm not really sure. Is this approach fine?
I'd suggest the 3rd option.
I don't know if Firebase supports such option yet.
At user's login save their FCM token
Group user's in your database
Run a foreach loop to send push notifications to the users that belong in one group.
I'm doing this in my own application and there is no much delay in Push notification delivery.
If you are using PHP as your server language you can use the curl_multi_init
This will send all the request at the same time. Hence the time required for your server to send all the Push notifications will be around 300ms.
On the other hand if you are not using PHP, there must be some similar ways you can achieve the same in your preferred language.
Keep in mind that there is no best implementation. It depends on the number of users using your app. It wouldn't be that wise to over-engineer this when you can do it really simple.

How to send push notification Firebase direct from app by code [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 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.

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.

Client to client communication with Cloud Endpoints [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 8 years ago.
Improve this question
I want to develop an Android application which would consist in a forum. I figured I should use the datastore to persist the members. However I was wondering how to implement the sending of posts and private messages to clients?
To be more specific, if A wants to send a message to B, what is the best way to handle this? Must I use Google Cloud Messaging or put A's message to the datastore, and then wait for B to query it?
It depends, both solutions are correct.
If you need instant messaging you should choose Google Cloud Messaging to implement this. Device identifier should be stored in the database, when a new message arrives it should be pushed to the specified device using the identifier. You should use notifications on Android side to notify user about new message.
You can also implement this using pull strategy. Message will be saved in the database and queried once user opens your application or clicks refresh button.
The technologies you've used in tags are the correct tools to implement such "forum" thing. Please read the documentation for Google Cloud Endpoints and Google Cloud Messaging because you'll find useful code snippets or even sample applications which will guide you how to achieve what you want.

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