<div dir="ltr">Hi,<div>Some questions and remarks inline<br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 19, 2014 at 9:58 AM, Miguel Lemos <span dir="ltr"><<a href="mailto:miguel21op@gmail.com" target="_blank">miguel21op@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Hello,<br><br>I'm still struggling, for saying the least, with Aerogear documentation in order to make a Cordova / Android app receive push notifications. <br>
Amazingly one of the most unexpected issues has been with the correct string to use on URLs to register or sending the notifications.<br>
<br>Examples given by documentation:<br><br>Openshift:<br><br>curl -u "{PushApplicationID}:{MasterSecret}"<br> -v -H "Accept: application/json" -H "Content-type: application/json"<br> -X POST<br>
-d '{<br> "someKey":"someValue",<br> "alert":"HELLO!",<br> "sound":"default",<br> "badge":7,<br> "simple-push":"version=123"<br>
}'<br>http://SERVER:PORT/CONTEXT/rest/sender/broadcast<br></div></div></blockquote><div><br></div><div>Can you post the link where you found this example , the "/broadcast" is outdated and should not appear in our doc </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><br>Aerogear:<br><br>curl -3 -u "{pushApplicationID}:{masterSecret}"<br>
-v -H "Accept: application/json" -H "Content-type: application/json"<br>
-X POST -d '{"message": {"alert":"AeroGear UnifiedPush and Apache Cordova 3.0.6", "badge":1}}'<br> https://SERVER:PORT/CONTEXT/rest/sender<br> <br><br>How the above examples, apparently mean that, in my case, I must use something like: <a href="https://aerogear-metalpush.rhcloud.com/rest/sender" target="_blank">https://aerogear-metalpush.rhcloud.com/rest/sender</a><br>
maybe is very obvious for someone inside Aerogear lingo, but not at all for me...<br><br></div></div></blockquote><div>Ok, it's specified here <a href="http://aerogear.org/docs/specs/aerogear-push-rest/Sender/">http://aerogear.org/docs/specs/aerogear-push-rest/Sender/</a> but maybe we should make it more obvious, thanks for pointing that out.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Anyway, after I managed to overcome this, the answer I get from the server is this one (stripped from more irrelevant parts):<br>
<br>
> POST /rest/sender HTTP/1.1<br>> Authorization: Basic MDBhMjFjZTMtYTdkOS00YzhjLWI1ODMtOWYwMjEwYTYzNGU1Ojk0MTE4NmIzLWVjNmEtNGY0OC1iMjZiLTJkMDYxZWIyM2Q5Yg==<br>> User-Agent: curl/7.30.0<br>> Host: <a href="http://aerogear-metalpush.rhcloud.com" target="_blank">aerogear-metalpush.rhcloud.com</a><br>
> Accept: application/json<br>> Content-type: application/json<br>> Content-Length: 50<br>><br>} [data not shown]<br>* upload completely sent off: 50 out of 50 bytes<br>< HTTP/1.1 200 OK<br>< Date: Tue, 18 Feb 2014 20:58:18 GMT<br>
* Server Apache-Coyote/1.1 is not blacklisted<br>< Server: Apache-Coyote/1.1<br>< Content-Type: application/json<br>< Content-Length: 13<br>< Vary: Accept-Encoding<br><<br>{ [data not shown]<br>100 63 100 13 100 50 11 44 0:00:01 0:00:01 --:--:-- 44Job submitted<br>
* Connection #0 to host <a href="http://aerogear-metalpush.rhcloud.com" target="_blank">aerogear-metalpush.rhcloud.com</a> left intact <br><br><br>As far as I can guess, this means that the request was accepted. Nevertheless, I receive nothing on the client's side.<br>
On my phone the successHandler function throws a success message, meaning that the equipment has managed to register at the service.<br><br>And my code to receive the notifications is the same given in some examples:<br>
<br>
function onNotification(e) {<br> alert(e.alert);<br>)<br><br>But nothing happens, tough. Thanks for giving me some clues to solve this.</div></div></blockquote><div><br></div><div>All of this looks correct, which version of Android are you using ?</div>
<div>Is it also possible to have the source of the cordova app you have built ?</div><div><br></div><div>For the issue itself the team is looking at this.</div><div><br></div><div>Thanks again for your interest.</div><div>
Seb </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><span class=""><font color="#888888"><br>
<br></font></span></div><span class=""><font color="#888888">Miguel<br><br></font></span></div>
<br>_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br></blockquote></div><br></div></div></div>