<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jul 29, 2014, at 10:29 AM, Daniel Bevenius <<a href="mailto:daniel.bevenius@gmail.com">daniel.bevenius@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">> <span style="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</span><div>
<font color="#333333" face="Helvetica, arial, freesans, clean, sans-serif"><span style="font-size:15px;line-height:25.5px">The 'Notification' section SimplePush Protocol [1] it specifies what should be returned. I'm not sure if Mozilla's server does something different of if it is the client side that does something different. </span></font></div></div></blockquote><div><br></div><div><span style="background-color: rgb(0, 0, 0);"><font color="#ffffff"> most likely it's the client side code that should be saving the pushEndpoint along with the channelID and then looking up by the channel ID, and then giving it to the user</font></span></div><div><span style="background-color: rgb(0, 0, 0);"><font color="#ffffff"><br></font></span></div><div><span style="color: rgb(240, 240, 240); font-family: Monaco; background-color: rgb(0, 0, 0);">this is probably what happens in the native browser code that we are trying to polyfill</span></div><blockquote type="cite"><div dir="ltr">
<div><font color="#333333" face="Helvetica, arial, freesans, clean, sans-serif"><span style="font-size:15px;line-height:25.5px">I'm not against changing things, but I think it makes sense for us to follow their protocol. I'll read up on the protocol and see if there is any new information that I'm not aware of. I'll take a look at their server too. </span></font></div>
<div><font color="#333333" face="Helvetica, arial, freesans, clean, sans-serif"><span style="font-size:15px;line-height:25.5px"><br></span></font></div><div><font color="#333333" face="Helvetica, arial, freesans, clean, sans-serif"><span style="font-size:15px;line-height:25.5px">[1] <a href="https://wiki.mozilla.org/WebAPI/SimplePush/Protocol#PushServer_-.3E_UserAgent_5">https://wiki.mozilla.org/WebAPI/SimplePush/Protocol#PushServer_-.3E_UserAgent_5</a></span><br>
</font><div><font color="#333333" face="Helvetica, arial, freesans, clean, sans-serif"><span style="font-size:15px;line-height:25.5px"><br></span></font><div><br></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On 29 July 2014 16:10, Lucas Holmquist <span dir="ltr"><<a href="mailto:lholmqui@redhat.com" target="_blank">lholmqui@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc 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,'Liberation Mono',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,'Liberation Mono',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;background-repeat:initial initial">window.navigator.mozSetMessageHandler('push', function(e) {
console.log('My endpoint is ' + e.pushEndpoint);
console.log('My new version is ' + 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><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,'Liberation Mono',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. <--- 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><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'd do it myself, but you know, it'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></div>
_______________________________________________<br>aerogear-dev mailing list<br><a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/aerogear-dev</blockquote></div><br></body></html>