Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Google Cloud Messaging from Android to Android possible?

I read about Google Cloud Messaging at http://developer.android.com/google/gcm/gcm.html.

It supports Third Party Application server to Android application push notification.

I am wondering whether it is possible to implement the same thing push/receive notification from an Android app on one mobile to the same Android app on another mobile using Google Cloud Messaging.

If not, is there any other free service available similar to Google Cloud Messaging?

like image 920
Ripal Tamboli Avatar asked Dec 11 '25 05:12

Ripal Tamboli


2 Answers

An Android device can send a GCM message to another Android device. All it needs is the API Key (of the Google API Project ID that the app uses to register to GCM) an the Registration ID of the other device. Using these parameters it can send a GCM message to another device via an HTTP request.

Usually applications that use GCM require a 3rd party server in order to store the Registration IDs of all registered devices. If your app has a different way to let devices share their Registration IDs with each other without requiring a server, you don't need the server.

like image 164
Eran Avatar answered Dec 13 '25 20:12

Eran


As far as I'm aware, there has to be a server in the middle to send the push notifications (Android -> Personal Server -> GCM Server -> Android)

So the Android device sending the notification would send some data to a script on the server (using a HTTP GET/POST), and that script would then send the push notifications to all the devices that you wanted it to

like image 28
Ben Ezard Avatar answered Dec 13 '25 20:12

Ben Ezard