0

I have a problem sending messages GCM with Xtify. My device is registered but it doesn't appear in Test Implementation. The app is testing. I send this message from my server to xtify it is accepted with 202 status code but the message doesn't reach the device.

{"apiKey":"blabla-2c0e-4c90-8845-753ed8ac3d64","appKey":"blabla-e6d0-441f-8b32-c0fc8be4ee5b","xids":["asdsd387242167c695bbac"],"sendAll":false,"content":{"subject":"Oferta","message":"lat=39.50017;lon=-0.43342;dis=50.0;oferta=1;","action":{"type":"NONE","data":"","label":""}}}

Where is the problem? Thank you

user1852854
  • 199
  • 1
  • 1
  • 11

1 Answers1

0

202 is a success codes, it means that xtify servers accepted the request but not necessarily deliver it to the device. I recommend following these steps to make sure your app registers with xtify, also make sure that your application in the app manger set to "Development / Testing" so you could be able to see it in the test page.


Push API call example for GCM:

URL: http://api.xtify.com/2.0/push

Content-Type: application/json

HTTP entity body:

{
    "apiKey": "xxxxxx-xxxxx-xxxx-xxxxx",
    "appKey": "xxxxxx-xxxxx-yyyy-xxxxx",
    "xids": ["xxxxxxxxxxxxxxxxxx"],
    "sendAll": true,
    "content": {
        "subject": "Greetings Earthlings",
        "message": "Take me to your leader",
        "action": {
            "type": "DEFAULT"
        }
    }
}
Community
  • 1
  • 1
Feras Alnatsheh
  • 547
  • 3
  • 9
  • I have reviewed all codes and I don't found any error. Now the device appears in test implementation but I don't have made any changes. I receive push from console, but if I send the push from my server I don't receive it. I use this class https://github.com/xtifyTools/xtifyTools/tree/master/PHPScripts. The response is the same 202. Thank you – user1852854 Feb 14 '13 at 14:43
  • I don't understand "but not necessariñy deliver it to the device". Why? Where can I see the test page? Do you referer to the Test Implementation page? I only see if the device is registered and now it appears. – user1852854 Feb 14 '13 at 15:31
  • For example if the device was offline you will still get 202. If the device shows up in the test page then select your device and click "deliver test notification", add at least title and content and make sure the action is set to alert. – Feras Alnatsheh Feb 14 '13 at 16:58
  • If you are using APIs and you want a notification to show up in the notification bar, then make sure to set the action to default in the api call. – Feras Alnatsheh Feb 14 '13 at 17:01
  • Great! It works! I change the type of action to default. Thank you very much!! – user1852854 Feb 14 '13 at 22:14