Android Question How do I listen to new messages from app?

Marvel

Active Member
Licensed User
I'm trying put the functionalities of JRDC2 by creating a chat app. The app communicates with the B4j server to get user_ids and send messages to that particular id. I've also been able to store the firebase token so the b4j server can automatically send out push notifications to users when messages are sent to them.

Now the question: What will be the best way to make the app listen for new messages? Right now I use the firebase message arrived sub to get new messages (I don't think that's the best)
I'm thinking of using Cloudkvs but I want to put it out here on the forum first in case anyone has solved this differently.
 

Marvel

Active Member
Licensed User
Firebase push messages is the best solution to receive messages while the app is not running.

You should also connect to your server and check for messages while your app is running. This can be done quite easily with WebSockets.

Thanks, I'll try using WebSockets
 
Upvote 0
Top