mel
mel

Reputation: 23

Sending an apps a notification from the server on android device

I am trying to send a notification to the application on the android device of all active and inactive users from a server. What do i need to use? GCM? The notification needs to to appear to all devices where the app has been installed in android.

Upvotes: 2

Views: 1110

Answers (2)

droidd
droidd

Reputation: 1371

You have to use Google Cloud Messaging (GCM) which google provided to achieve this type of functionality. Instead of hitting the server from the client on regular basis. The server will send the message to the client if he has any message for their clients. https://developer.android.com/google/gcm

Upvotes: 1

BeingMIAkashs
BeingMIAkashs

Reputation: 1385

GCM is enough for your case. Maintain a user table which store the user register ID. Then you can send GCM message from your server to the indented users using the user register ID. See this GCM tutorial

Upvotes: 1

Related Questions