Google Cloud Messaging using a computer

I'm not sure if this is the wrong StackExchange, so if so please let me know.

I am making an android application for which I would like to use GCM. Unfortunately I don't have a server to run this. The best I have is a web server hosted by GoDaddy. So, since I decided to run GCM from my webserver, it won't work, I need to find another way. So my question is, is it possible to use a local machine with GCM instead of a server? This way I can use my laptop instead of the server.

Plus, if you know how to do GoDaddy hosting with GCM, it's even better. GoDaddy is a shared web hosting account, not a VPS or dedicated server.

Thank!

+3


source to share


2 answers


Yes, you can send a GCM message from your local machine to your Android device via the GCM server. All you need is to connect to the Internet and send an HTTP request to the GCM HTTP endpoint.

However, in order to send such a message, you need to know the registration ID of the device that is to receive the message. The device app is assigned this ID when it registers with GCM. Usually, as soon as the application receives this ID, it passes it to your server. If you are using your local computer as a server, it will be difficult for you to send the registration ID from your application to it (although you can do this if you are using a local web server on your local computer and the Android device and your computer are connected to the Internet over the same network).



Of course, you can always copy the registration ID manually and paste it into your code that sends GCM messages.

+2


source


Yes it is possible, essentially using this gcm to test my gcm client on the phone. I wrote a gcm-client abstraction for a simpleton like me here



hope this helps :).

+3


source







All Articles