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.
Related
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.
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 5 years ago.
Improve this question
I am developing an Android application in which someone can register as user or as company. If someone registers as user, he will get a list of all the registered companies, from dropdown he can select any company and can send some information to it.
I want that whenever a user selects a company and click the button to submit information to the company, the selected company (has also installed my application and is signed into the app) get a notification.
I am using Firebase for storing user and company details and also to register them.
I don't want to use any third party sever.
Any help will be appreciable. Thanks!!
Did you try Firebase Cloud Messaging? FCM can send notifications to user/s from console and/or API.
Well you should look into push notifications a little more .
As you are using firebase it is advisable to use FCM.
https://firebase.google.com/docs/cloud-messaging/concept-options
This has all the information you will require
There are many good alternatives to FCM too.It won't hurt to look into them either
pushy:https://pushy.me
SNS:https://aws.amazon.com/sns
push Whoosh:http://androidbash.com/android-pushwoosh-integration/
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.
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 7 years ago.
Improve this question
I want to develop a cross platform chat application which I can use to send text,url,image,location,video to my friends which can be on android/ios/web.
I want chat to be realtime, and want to make sure that even if user is not using application, he get a 'Notification' for new incoming chat message.
How to do it using just Firebase or just Parse or just PubNub? If it is not possible, we can explore possibility of using them in combination.
Notes / Problems:
1. Firebase: it has 'Firechat' for web, 'firechat/swiftchat' for iOS and 'chat' for android. how to synchronize them with each other?
PubNub has limitation of sending just 32kb in one message.
I read few places that Parse does not support realtime chat?
I tried searching for different questions here already, but did not find any solution that will satisfy all my requirements.
Use PubNub for realtime chat. There are SDKs for all platforms you listed.
For images, you send/receive the data with a image url, while storing the images using Parse.
As long as you use the same credentials (your pub/sub keys) to publish all messages to the same channel, all messages are synced no matter what platform your users are on.
For push notifications, you should be able to use either PubNub or Parse.
If you need to map user locations in realtime, try EON by PubNub too.
http://www.pubnub.com/developers/eon/
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.