1
votes

I'm trying to send push notifications (gcm) using example from Google Cloud Messaging for Android Library. extras/google/samples/ I set up server and i can register device on it, it returns registration id but doesn't push notification to mobile device.

things i have changes from sample: server - api key (browser/server tried both) on client side: SERVER_URL and SENDER_ID

on html page that is included with demo example after run application : 1 device(s) registered!(with logs i can see that id and looks correct), after push Send Message : Sent message to one device: [ messageId=0:1369738939369676%921c249af9fd7ecd ]and it doesnt show up on mobile device.

What could be a problem, about what did i forgot?

i was able to read response from gcm (i guess) :

MulticastResult(multicast_id=6144555349590101172,total=1,success=1,failure=0,canonical_ids=0,results: [[ messageId=0:1369749519814767%921c249a00000031 ]]
2
Since you got a success response from Google, your server side code seems to work fine. The problem may be in your Android app code or in your manifest. What do you see in the logcat? Can you include your code in the question?Eran

2 Answers

2
votes

Make sure you have proper auth token, in your server implementation.

String authToken = "AIzacq9Twg20j6g-sas............";
sender = new Sender(authToken);

This AuthToken should be taken from GCM portal and it should be mapped to SENDERID, you should use Sender ID in android app.

0
votes

problem was caused bcs of firewall and blocked ports 5228-5230, admin unblocked that ports and all works like a charm