I have Android client where the user talks to another user (or X users) and for each new message received is notified “new message arrived”.The messages are managed in a PHP web server that should send the notifications to the client Android.
I’ve been using Google Cloud Messaging that makes requests PUSH by our web server to our client Android, through Google’s servers. The work seems straightforward.
The question is: how does our web server to “wake up” and send notification when appropriate? What is the best way to do this?
In the case of notification of a new message from a user X, the server what should do to activate?
I can not imagine a basic approach except that the polling on the server!
Any idea?
thanks
See this it is the complete tutorial
http://developer.android.com/guide/google/gcm/gs.html
http://developer.android.com/guide/google/gcm/gcm.html#arch
Thanks
when device Y starts app, call a service to save dev.ID to server first time.
now, send a dev.Id to server with every message.
on server, when message will receive fire the notification with dev.Id and Message.