You can start the service after registering with the server.
onStartCommand user login service.
Deploy a service using PacketListener, ConnectionListener, InvitationListener
PacketListener to receive Groupcaht or One one One chat messages.
ConnectionListener to check if the connection to the server is connected or disconnected.
InvitingListener . To receive group invitations.
After successfully logging in, add these listeners.
Now that the message is received, save this message in the local database and send a broadcast for actions that want the message to be received.
Check if the app is running in the background, if so, then send a notification for a new message
Email me if any buddy ran into any problem cvofjaspreet@gmail.com
source share