<div dir="ltr">Hello Miguel,<div><br></div><div>thanks for reaching out.</div><div><br></div><div>One thing on the OpenShift documentation, what the URL you are referencing ? </div><div><br></div><div>A few things on OpenShift versus local deployment:</div>
<div><br></div><div>* http vs. https:</div><div>For the OpenShift cartridges we have enabled https, If you run locally (e.g. inside of your JBoss/WildFly container) https is a pain, hence http might be referenced somewhere<br>
</div><div><br></div><div>* <span style="font-family:arial,sans-serif;font-size:13px">CONTEXT:</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">On Openshift the UnifiedPush Server is deployed as root (/) context. If you locally deploy the war file, the context is /nameOfYourWarFile</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Regarding not receving messages on the Android device:</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">* what is the Android OS on the device</span></div><div><font face="arial, sans-serif">* is there an (active) Google account on the device </font></div><div><font face="arial, sans-serif"><br>
</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">One more question: The registration works, right ? </font></div><div><font face="arial, sans-serif"><br></font></div><div>
<pre class="" style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:11.818181991577148px;line-height:15.272726058959961px;width:1243.6363525390625px;margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(0,0,0)">
<div class="" id="file-cheat-sheet-txt-LC32">var pushConfig = {</div><div class="" id="file-cheat-sheet-txt-LC33">  // senderID is only used in the Android/GCM case</div><div class="" id="file-cheat-sheet-txt-LC34">  senderID: &quot;SomeSenderID&quot;,</div>
<div class="" id="file-cheat-sheet-txt-LC35">  pushServerURL: &quot;someULR&quot;,</div><div class="" id="file-cheat-sheet-txt-LC36">  variantID: &quot;someID&quot;,</div><div class="" id="file-cheat-sheet-txt-LC37">  variantSecret: &quot;someSecret&quot;,</div>
<div class="" id="file-cheat-sheet-txt-LC38">  alias: &quot;someAlias&quot;</div><div class="" id="file-cheat-sheet-txt-LC39">                }</div></pre></div><div><br></div><div><br></div><div>Question: Do you see the device listed as the installation, on the OpenShift hosted Push Server ? </div>
<div><br></div><div>Thanks,</div><div>Matthias</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 19, 2014 at 9:58 AM, Miguel Lemos <span dir="ltr">&lt;<a href="mailto:miguel21op@gmail.com" target="_blank">miguel21op@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello,<br><br>I&#39;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 &quot;{PushApplicationID}:{MasterSecret}&quot;<br>   -v -H &quot;Accept: application/json&quot; -H &quot;Content-type: application/json&quot;<br>   -X POST<br>

   -d &#39;{<br>       &quot;someKey&quot;:&quot;someValue&quot;,<br>       &quot;alert&quot;:&quot;HELLO!&quot;,<br>       &quot;sound&quot;:&quot;default&quot;,<br>       &quot;badge&quot;:7,<br>       &quot;simple-push&quot;:&quot;version=123&quot;<br>

     }&#39;<br>http://SERVER:PORT/CONTEXT/rest/sender/broadcast<br><br>Aerogear:<br><br>curl -3 -u &quot;{pushApplicationID}:{masterSecret}&quot;<br>   -v -H &quot;Accept: application/json&quot; -H &quot;Content-type: application/json&quot;<br>

   -X POST -d &#39;{&quot;message&quot;: {&quot;alert&quot;:&quot;AeroGear UnifiedPush and Apache Cordova 3.0.6&quot;, &quot;badge&quot;:1}}&#39;<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>Anyway, after I managed to overcome this, the answer I get from the server is this one (stripped from more irrelevant parts):<br><br>

&gt; POST /rest/sender HTTP/1.1<br>&gt; Authorization: Basic MDBhMjFjZTMtYTdkOS00YzhjLWI1ODMtOWYwMjEwYTYzNGU1Ojk0MTE4NmIzLWVjNmEtNGY0OC1iMjZiLTJkMDYxZWIyM2Q5Yg==<br>&gt; User-Agent: curl/7.30.0<br>&gt; Host: <a href="http://aerogear-metalpush.rhcloud.com" target="_blank">aerogear-metalpush.rhcloud.com</a><br>

&gt; Accept: application/json<br>&gt; Content-type: application/json<br>&gt; Content-Length: 50<br>&gt;<br>} [data not shown]<br>* upload completely sent off: 50 out of 50 bytes<br>&lt; HTTP/1.1 200 OK<br>&lt; Date: Tue, 18 Feb 2014 20:58:18 GMT<br>

* Server Apache-Coyote/1.1 is not blacklisted<br>&lt; Server: Apache-Coyote/1.1<br>&lt; Content-Type: application/json<br>&lt; Content-Length: 13<br>&lt; Vary: Accept-Encoding<br>&lt;<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&#39;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.<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><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><br clear="all"><div><br></div>-- <br>Matthias Wessendorf <br>
<br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a>
</div>