Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android GCM message for one device to other

I want to use google GCM for sending message from device A to device B. My app does not use any other server. The GCM will generate registration id for devices. How to send the message to a particular device (From A to B) among a number of devices.

like image 395
user1548603 Avatar asked Nov 07 '12 11:11

user1548603


1 Answers

For sending push notifications, you need a senderid and server key registered with google.

You could possibly send the push notification to GCM from the device itself, but will have to keep the server key in the source code for the App. Depending on your level of code obfuscation, anyone can eventually get the server key, and take over push notifications pretending they are your app. Good luck.

In reply to AKS ............. What we are looking at here is a de-centralized or peer-to-peer system .. There are registration ids associated with each device(as per GCM)... one way is using p2p algorithms all devices maintain a 'ledger' of all registration ids and specify which ones to send a particular message to. Of course, other possibilities also exist depending on application logic and feasibility.

like image 161
cosmicnag Avatar answered Sep 28 '22 07:09

cosmicnag