Datz
Datz

Reputation: 69

Google Cloud Messaging local testing on an external device

I'm trying to implement Google Cloud Messaging for my app in development. I'm following the walkthrough located in the readme a this github repository (the official Google sample project). I'm doing everything that's asked, but I'm confused as to how to test this. As far as I know I have the backend running from my computer (I can connect to the backend from localhost:8080 in chrome), but I want to test device registration with an external device (Samsung Galaxy S4). I realize that the device cannot try to connect to 10.0.2.2 because that makes the device think it's connecting to localhost on the phone itself. I tried entering my computer's IP address with both ports 8080 and 80, but the request times out before anything happens. I'm fairly certain I have the correct Server API Key and Sender ID.

Is there anything which might be wrong here? How can I connect to my computer from the phone? I'm willing to post code and/or error logs if needed. Running LinuxMint 17.2 x64.

Upvotes: 0

Views: 88

Answers (2)

Dhaval Solanki
Dhaval Solanki

Reputation: 4705

Fro GCm Testing you not require to do more thing only get your device token and get you project Auth API key from google developer console test using some tool like ,https://gcm.codeplex.com/

and you can copy your device token using edittext,textview or other thing,

Upvotes: 0

Sangeet Suresh
Sangeet Suresh

Reputation: 2545

if you are on same network , just type the internal ip address of the computer followed by port number , you can test it in the browser itself in phone

Upvotes: 1

Related Questions