-1

I am making a chatting application in which I have successfully implemented chatting functionality. But my chatting works well when the two persons have both opened the chat screen opened in their phones. If the other person is not on the same screen then the chat message sent by one person is lost. I want here that if the other is not on the same screen then the he/she should receive the chat message as a notification. Please help me regarding the same.

Thanks

Gaurav Arora
  • 8,282
  • 21
  • 88
  • 143
  • Are you using any server for this? – Anupam Oct 16 '12 at 05:37
  • Yes, I using XMPP with openfire – Gaurav Arora Oct 16 '12 at 05:39
  • Why don't you use GCM service for that? GCM doesn't require that you are using the app or not whenever anything gets in the server the android system wakes the app and display the notification. – Anupam Oct 16 '12 at 05:41
  • ok Thanks. any preferred link for the same?? – Gaurav Arora Oct 16 '12 at 05:50
  • But i am bound to use XMPP with openfire. – Gaurav Arora Oct 16 '12 at 05:51
  • http://developer.android.com/guide/google/gcm/gs.html http://developer.android.com/guide/google/gcm/demo.html http://developer.android.com/guide/google/gcm/gcm.html http://developer.android.com/guide/google/gcm/gcm.html#server http://stackoverflow.com/questions/11242743/gcm-with-php-google-cloud-messaging Hope that helps! – Anupam Oct 16 '12 at 05:52
  • See this question here! I think this will solve your confusion. http://stackoverflow.com/questions/12215113/what-is-diffrence-implementing-xtify-using-gcm-and-xtify-using-xmpp-in-android – Anupam Oct 16 '12 at 05:54

1 Answers1

-1

You can do like whenever you will send chat msg just check for the user's online status by the server, If it is not then send that msg using notification...

Regards,

Div S
  • 231
  • 2
  • 11
  • the user will always be online bro. The thing when he/she is working on the application but is not on the chat screen, then what happens?? – Gaurav Arora Oct 16 '12 at 05:54