<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 29, 2014 at 4:10 PM, Lucas Holmquist <span dir="ltr">&lt;<a href="mailto:lholmqui@redhat.com" target="_blank">lholmqui@redhat.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 style="word-wrap:break-word"><h3 style="margin-bottom:15px;line-height:1.7;margin-right:0px;margin-left:0px;padding:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px!important">
<span style="font-weight:normal">so this sort of relates to this thread here:</span></h3><h3 style="margin-bottom:15px;line-height:1.7;margin-right:0px;margin-left:0px;padding:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px!important">
<a href="http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-Differences-between-Firefox-OS-quot-native-quot-Push-lib-and-AeroGear-s-Push-adapter-td6195.html" target="_blank">http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-Differences-between-Firefox-OS-quot-native-quot-Push-lib-and-AeroGear-s-Push-adapter-td6195.html</a></h3>
<h3 style="margin-bottom:15px;line-height:1.7;font-size:1.5em;margin-right:0px;margin-left:0px;padding:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px!important"><span style="font-size:15px;line-height:25.5px"><br>
</span></h3><h3 style="margin-bottom:15px;line-height:1.7;font-size:1.5em;margin-right:0px;margin-left:0px;padding:0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px!important"><span style="font-size:15px;line-height:25.5px"><br>
from</span><span style="font-size:15px;line-height:25.5px"> </span><a href="https://developer.mozilla.org/en-US/docs/Web/API/Simple_Push_API#Add_the_push_message_handler" rel="noreferrer" style="font-size:15px;line-height:25.5px;color:rgb(65,131,196);text-decoration:none" target="_blank">https://developer.mozilla.org/en-US/docs/Web/API/Simple_Push_API#Add_the_push_message_handler</a><br>
Moz example</h3><pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:13px;margin-top:15px;margin-bottom:15px;border:1px solid rgb(221,221,221);line-height:19px;overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-wrap:normal;color:rgb(51,51,51);background-color:rgb(248,248,248)">
<code style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:12px;margin:0px;border:none;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;padding:0px;word-wrap:normal;display:inline;line-height:inherit;background-color:transparent">window.navigator.mozSetMessageHandler(&#39;push&#39;, function(e) {
    console.log(&#39;My endpoint is &#39; + e.pushEndpoint);
    console.log(&#39;My new version is &#39; +  e.version);
    //Remember that you can handle here if you have more than
    //one pushEndpoint
    if (e.pushEndpoint === emailEndpoint) {
        emailHandler(e.version);
    } else if (e.pushEndpoint === imEndpoint) {
        imHandler(e.version);
    }
});
</code></pre><p style="margin:15px 0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15px;line-height:25.5px">The notification that they send back includes the pushEndpoint and the version</p>
</div></blockquote><div><br></div><div>Using the little hack, I am not seeing the pushEndpoint being returned by their server:</div><div><a href="https://gist.github.com/matzew/cbda360d72eaaef75971">https://gist.github.com/matzew/cbda360d72eaaef75971</a><br>
</div><div><br></div><div><br></div><div><br></div><div><br></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 style="word-wrap:break-word"><p style="margin:15px 0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15px;line-height:25.5px">Currently, when we do <code style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:12px;margin:0px;border:1px solid rgb(221,221,221);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;padding:0px;background-color:rgb(248,248,248)">navigator.push.register()</code> the result we send back is an object that includes the pushEndpoint, this is actually changing to be more in line with Mozilla. Instead of the object being sent back, we will send back the pushEndpoint as a String. &lt;--- is a super easy change that sebi already did, just need to re-merge it back in</p>
<p style="margin:15px 0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15px;line-height:25.5px">but in our message handler, our notification that is sent back includes the channelId and version</p>
</div></blockquote><div><br></div><div>here is, the JSON I receive w/ the above hack:</div><div><span style="color:rgb(48,57,66);font-family:Menlo,monospace;font-size:11px;white-space:pre-wrap">{&quot;messageType&quot;:&quot;notification&quot;,&quot;updates&quot;:[{&quot;channelID&quot;:&quot;d9b74644-4f97-46aa-b8fa-9393985cd6cd&quot;,&quot;version&quot;:3}]} </span><br>
</div><div><br></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 style="word-wrap:break-word">
<p style="margin:15px 0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15px;line-height:25.5px">I believe the server should now be sending the pushEndpoint in the notification instead.</p>
<p style="margin:15px 0px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15px;line-height:25.5px">I&#39;d do it myself, but you know, it&#39;s java</p></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>