I use gottox/socket.io-java-client on android chat app.And Now I want to use socket.io as a background service.In chat app If a new message (when chat app is closed),send a notification like "new message on chat app-click here if you want to see. How can I do that? I did a chat app with node.js,gottox on android.But I need this app work as a background service on phone.Do you have any plugins or examples?
Asked
Active
Viewed 7,608 times
2
-
how you manage one to one message? do you save user credential to database ? please share your experience . – Shihab Uddin Jun 16 '16 at 06:43
1 Answers
0
A service or any other Android component can be closed by the operating system. The solution is to use Android notifications to wake up any component.
-
1how to check a new message If I cant use service when app is closed?how can I wake up the app on background without service?such as whatsapp,messenger.If There is a new message,send a new message.applications even when turned off – erginduran Aug 09 '14 at 19:21
-
you will have a Receiver where you will be able to manage that notification: start the server... or whatever – mromer Aug 09 '14 at 19:25
-
-
For example, http://developer.android.com/google/gcm/client.html. Here you can see notifications using google cloud messaging. They are using a GcmBroadcastReceiver to manage when you have a new message. So you will get a notification from server and you will have a BroadcastReceiver to manage that notification. There you can open your service. Sorry if I am not explaining well – mromer Aug 09 '14 at 19:34
-