<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 27, 2014 at 12:29 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><div>Yes, I tried it. It&#39;s easy.<br><br></div>Do you know, for me, what&#39;s one of the biggest - unexpected - hurdle to surpass? The information you people give about the URLs to use, etc.; it varies according to the platform (&quot;context&quot; for using your terminology). For instance, someone that  is on Cordova / mobile , must use something different from  another guy targeting etwas anderes... And for a newbie  arriving from outside to your ecosystem it&#39;s not so easy as you might think.<br>
</div></div></blockquote><div><br></div><div>The context is a well defined thing in the Java world (it comes from the Servlet Spec). I am not really sure hot to name it better :-(</div><div><br></div><div>http(s)://server:port/context </div>
<div><br></div><div>But I think that all our docs are using the same &#39;schema&#39; of the URL (the OpenShift blog is an outdated announcement, not really documentation).<br></div><div><br></div><div>Where do you think we use the URL totally differently, in our docs (not the outdated OpenShift blog post) ?</div>
<div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>
<br></div><div>Thanks for your support.</div></div></blockquote><div><br></div><div>You are welcome!</div><div><br></div><div>We are all happy that it works, and we are also very much willing to improve our docs etc.</div>
<div><br></div><div>Thanks for pointing out issues</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span class="HOEnZb"><font color="#888888"><br>
<br></font></span></div><span class="HOEnZb"><font color="#888888"><div>M<br></div><div><br></div><div><br></div></font></span></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Mon, Feb 24, 2014 at 6:21 PM, Matthias Wessendorf <span dir="ltr">&lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div>On Mon, Feb 24, 2014 at 7:14 PM, Matthias Wessendorf <span dir="ltr">&lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt;</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"><br><div class="gmail_extra"><br><br><div class="gmail_quote">


<div>On Mon, Feb 24, 2014 at 6:36 PM, 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: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">That would be neat if  I understand a simple way to send a  push to a particular dude&#39;s phone. So far I&#39;ve not yet understood how... <br>



</div></blockquote><div><br></div><div><span style="line-height:23.18181800842285px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif"><br></span></div></div><div><span style="line-height:23.18181800842285px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif">use an alias that is </span><em style="line-height:23.18181800842285px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif">unique</em><span style="line-height:23.18181800842285px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif"> </span><span style="line-height:23.18181800842285px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif">(E.g. the user-id in your backend):</span><br>



</div><div><pre style="background-color:rgb(248,248,248);border-top-left-radius:3px;margin-bottom:15px;padding:6px 10px;line-height:19px;border-top-right-radius:3px;font-size:13px;overflow:auto;border-bottom-right-radius:3px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;word-wrap:normal;margin-top:15px;border:1px solid rgb(221,221,221);border-bottom-left-radius:3px">
<code style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:inherit;margin:0px;border:none;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline;vertical-align:middle;padding:0px;word-wrap:normal">curl -3 -u &quot;{variantID}:{secret}&quot;
    -v -H &quot;Accept: application/json&quot; -H &quot;Content-type: application/json&quot; 
    -X POST
    -d &#39;{
      &quot;deviceToken&quot; : &quot;someTokenString&quot;,
      &quot;alias&quot; : &quot;myUniqueString&quot;
     }&#39;

https://SERVER:PORT/context/rest/registry/device
</code></pre><p style="line-height:23.18181800842285px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">Now, the above does store this string (the <code style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:1.3;margin:0px;border:1px solid rgb(221,221,221);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;max-width:100%;display:inline-block;overflow:auto;vertical-align:middle;padding:0px;white-space:nowrap">alias</code> <span style="font-size:15.454545021057129px">) on the device metadata.</span></p>


</div></div></div></div></blockquote><div><br></div><div><br></div><div><br></div><div><br></div></div><div><p style="line-height:23.18181800842285px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">


Oh, since you are using Cordova, I translated the generic curl (from our REST API doc) to JavaScript:</p><pre style="background-color:rgb(248,248,248);border-top-left-radius:3px;margin-bottom:15px;padding:6px 10px;line-height:19px;border-top-right-radius:3px;font-size:13px;overflow:auto;border-bottom-right-radius:3px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;word-wrap:normal;margin-top:15px;border:1px solid rgb(221,221,221);border-bottom-left-radius:3px">
<code style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:inherit;margin:0px;border:none;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline;vertical-align:middle;padding:0px;word-wrap:normal">var pushConfig = {
    // senderID is only used in the Android/GCM case
    senderID: &quot;&lt;senderID e.g Google Project ID only for android&gt;&quot;,
    pushServerURL: &quot;&lt;pushServerURL e.g http(s)//host:port/context &gt;&quot;,
    variantID: &quot;&lt;variantID e.g. 1234456-234320&gt;&quot;,
    variantSecret: &quot;&lt;variantSecret e.g. 1234456-234320&gt;&quot;,


    alias: &quot;myUniqueString&quot; // NOTE!! this must be unique to the user. Do not hard-code that string ;)
    // Recommendation is: username;

    // the user logins to your backend system. After a successful login you should know the username, which can than
    // be used when the &#39;JavaScript&#39; for the device registration is being executed;

}

//badge and sound are iOS specific, and ignored on Android
push.register(successHandler, errorHandler, {&quot;badge&quot;: &quot;true&quot;, &quot;sound&quot;: &quot;true&quot;,
    &quot;ecb&quot;: &quot;onNotification&quot;, pushConfig: pushConfig});

</code></pre></div><div><br></div><div><br></div><div><br></div><div><br></div></div><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></div></div>
<br></div></div><div class="">_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">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></div></blockquote></div><br></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></div>