<div dir="ltr">Hi.  Thank you all.  I successfully got multiple registration working last week.  <div><br></div><div><ol><li>Sebastien, what is the purpose of using the local storage to store the mapping between channel ID and category?  I&#39;m at this time keeping the map in memory.</li>
<li>Matthias, using the current time makes sense.  I&#39;ll do that.  Why didn&#39;t I think about that?</li></ol></div><div><br></div><div>Thank you all again for your attention and advice thus far.<br></div><div><br></div>
<div>Michi</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 4, 2014 at 5:13 AM, 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello Michi,<div><br></div><div>IMO the version number string is a bit odd for most backend applications. :-) If you don&#39;t want to maintain a &quot;version per channel&quot;, I&#39;d just do the current timestamp (e.g. Date.now() in JS)</div>

<div><br></div><div>-M</div></div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Fri, Apr 4, 2014 at 11:04 AM, Sebastien Blanc <span dir="ltr">&lt;<a href="mailto:scm.blanc@gmail.com" target="_blank">scm.blanc@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">Hey Again ! <div><br><div>To make it even easier I&#39;ve deployed a &quot;multi-channel&quot; version of the quickstart here  : <a href="http://mutlichannels-sblanc.rhcloud.com/" target="_blank">http://mutlichannels-sblanc.rhcloud.com/</a></div>


<div>Then you can fire the CURLs for each category to see how it can handle different channels : </div><div><br></div><div><pre style="line-height:13.4399995803833px;width:1216.800048828125px;font-size:12px;margin-bottom:0px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;margin-top:0px;padding:0px">
<div>curl -3 -u &quot;a0f6a30e-0cda-49a4-9901-bcfdc30e5c7a:b986c86e-4092-4728-a1ed-7ac68f6d0f7a&quot; -v -H &quot;Accept: application/json&quot; -H &quot;Content-type: application/json&quot; -X POST -d &#39;{</div>
<div>       &quot;categories&quot; :[&quot;mail&quot;],</div><div>       &quot;simple-push&quot;: &quot;version=1111&quot;</div><div>
     }&#39; <a href="https://hackergartenups-sblanc.rhcloud.com/rest/sender" target="_blank">https://hackergartenups-sblanc.rhcloud.com/rest/sender</a></div><div><br></div><div>
<br></div><div><pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;width:1216.800048828125px;margin-top:0px;margin-bottom:0px;padding:0px"><div>
curl -3 -u &quot;a0f6a30e-0cda-49a4-9901-bcfdc30e5c7a:b986c86e-4092-4728-a1ed-7ac68f6d0f7a&quot; -v -H &quot;Accept: application/json&quot; -H &quot;Content-type: application/json&quot; -X POST -d &#39;{</div><div>
       &quot;categories&quot; :[&quot;news&quot;],</div><div>       &quot;simple-push&quot;: &quot;version=1112&quot;</div><div>     }&#39; <a href="https://hackergartenups-sblanc.rhcloud.com/rest/sender" target="_blank">https://hackergartenups-sblanc.rhcloud.com/rest/sender</a></div>


<div><br></div><div><br></div><div>If you fire these multiple time don&#39;t forget to change the version value ! </div>
<div><br></div><div><br></div></pre></div></pre></div><div><br></div></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 4, 2014 at 10:02 AM, Sebastien Blanc <span dir="ltr">&lt;<a href="mailto:scm.blanc@gmail.com" target="_blank">scm.blanc@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">Hey Michi,<div>I realized that the code I pointed you to could be a bit confusing and also contains a small bug.</div>


<div><br></div><div>I wrote this gist based on the quickstart example. Basically we register to 2 channels : mail and news, we store the channelID and map that with a String containing the service name, then in the onNotification we check which service to call : </div>



<div><br></div><div><a href="https://gist.github.com/sebastienblanc/9970129" target="_blank">https://gist.github.com/sebastienblanc/9970129</a><br></div><div><br></div><div>Hope this example will make more sense ! </div>


<div><br></div><div>
Seb</div><div><br></div><div><br></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 3, 2014 at 8:53 PM, Sebastien Blanc <span dir="ltr">&lt;<a href="mailto:scm.blanc@gmail.com" target="_blank">scm.blanc@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">Looks at this more advanced example here <a href="https://github.com/aerogear/aerogear-aerodoc-web/blob/master/scripts/services/notifierService.js" target="_blank">https://github.com/aerogear/aerogear-aerodoc-web/blob/master/scripts/services/notifierService.js</a> <div>




<br></div><div>You will see that we register 2 times and we get 2 different endpoints. Then you have to keep somewhere a link between your endpoint and let&#39;s say the service you want to associate to , like using the localStorage : localStorage.setItem(theEndpoint, &quot;scoreService&quot;); <br>




</div><div><br></div><div>Then when you receive a message, besides the version (which is btw not mandatory to be used) you also receive the channelId, then you can choose which service to call : </div><div><br></div><div>




<pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;margin-top:0px;margin-bottom:0px;color:rgb(51,51,51);line-height:18px"><div style="padding-left:10px;min-height:18px">
 <span>navigator</span><span>.</span><span>setMessageHandler</span><span>(</span><span style="color:rgb(221,17,68)">&quot;push&quot;</span><span>,</span> <span style="font-weight:bold">function</span><span>(</span><span>message</span><span>)</span> <span>{</span></div>




<div style="padding-left:10px;min-height:18px">                var myService = localStorage.get(<span>message</span><span>.</span><span>channelID</span><span>);</span></div>
<div style="padding-left:10px;min-height:18px">                //now based on this you can call your specific log</div><div style="padding-left:10px;min-height:18px">        <span>});</span></div><div style="padding-left:10px;min-height:18px">




<span><br></span></div><div style="padding-left:10px;min-height:18px"><span>I Hope this will help you.</span></div><div style="padding-left:10px;min-height:18px">
<span><br></span></div><div style="padding-left:10px;min-height:18px"><span><br></span></div></pre></div><div><br></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">

On Thu, Apr 3, 2014 at 8:03 PM, Michi Oshima <span dir="ltr">&lt;<a href="mailto:michi.oshima@gmail.com" target="_blank">michi.oshima@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">Thank you, Sebastien.  I&#39;ll try multiple registration.  Although, I&#39;m a bit confused.  Because:<div><br></div><div><ol><li>As far as I can see from <a href="https://github.com/aerogear/aerogear-simplepush-unifiedpush-quickstart" target="_blank">the quick start example</a>, per SPS Client, there&#39;ll be one registration with the SimplePush server.  That means I only get one endpoint.<br>





</li><li>So I&#39;d use the same endpoint to register multiple times with the unified push server using different category each time.<br></li><li>When the SPS client receives a version number, how can it associate a given version number to a particular category?  (I&#39;ve not seen categories reaching the client.)<br>





</li></ol></div><div><br></div><div>Am I wrong somewhere above?  </div><div><br></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 3, 2014 at 10:53 AM, Sebastien Blanc <span dir="ltr">&lt;<a href="mailto:scm.blanc@gmail.com" target="_blank">scm.blanc@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"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div>On Thu, Apr 3, 2014 at 4:41 PM, Michi Oshima <span dir="ltr">&lt;<a href="mailto:michi.oshima@gmail.com" target="_blank">michi.oshima@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>Hi Lucas,</div><div><br></div><div>Following might do what I want (sending a &quot;door bell&quot; message in one shot to all variants)?  Send a unified message like the following one:</div>






<div><br></div>
<div><ul><li><span style="color:rgb(136,0,0);font-family:monospace,serif;font-size:11px;line-height:15px;white-space:pre-wrap;background-color:rgb(240,240,240)">&#39;{ </span><span style="color:rgb(136,0,0);font-family:monospace,serif;font-size:11px;line-height:15px;white-space:pre-wrap;background-color:rgb(240,240,240)">&quot;message&quot;: { &quot;version&quot;:&quot;123&quot; }, &quot;simple-push&quot;: &quot;version=123&quot; }&#39;</span><br>







</li></ul></div><div><br></div><div>One slight deviation is that mobile variants like iOS and Android will get the message regardless of whether the the version number is &quot;old&quot; or not.  Is this correct?</div></div>






</blockquote><div> </div></div><div>Yes iOS/Android ignore the version since that is really something tied to Simple Push </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>So I revisited the <a href="https://wiki.mozilla.org/WebAPI/SimplePush" target="_blank">SimplePush spec</a>, and I noticed it describes support for subscription to multiple channels.  </div><div><br></div>






Aerogear doesn&#39;t allow multiple channels per installation, correct?  I dug up an old post from Matthias:<div>
<br></div><div><ul><li><a href="http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-SimplePush-Registration-of-quot-Mobile-Variant-instance-quot-w-Unified-Push-Server-tt2805.html#none" target="_blank">http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-SimplePush-Registration-of-quot-Mobile-Variant-instance-quot-w-Unified-Push-Server-tt2805.html#none</a></li>






</ul></div></div></blockquote></div><div>Well yes,  but multiple installations can belong to the same SPS Client. You can register multiple time, differentiate them by passing them a category for instance.</div><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><ul><li><br>
</li></ul></div><div><br></div><div>If an installation can subscribe to multiple channels, then it would allow me to get what I originally asked about:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">







<div>Me: &#39;<span style="font-family:arial,sans-serif;font-size:13px">My client application (javascript on browser) holds multiple types of data.  It would be nice if I can send a notification saying &quot;there&#39;s an update for this data type&quot;, rather than just &quot;there&#39;s an update&quot;.  Or, in general it&#39;d be nice if I can send more information than just a monotonically increasing number. &#39;</span></div>







</blockquote><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">What do you think?</span></div></div></blockquote><div><br></div>






</div><div>That would be quite a breaking change and we need to discuss that, in the same time, as said before, you can still register a single client to multiple channels (and es you will have multiple installations but that do not really matter) </div>





<div><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><div><div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Apr 2, 2014 at 11:44 AM, 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">







<div style="word-wrap:break-word"><div><div>On Apr 2, 2014, at 11:38 AM, Michi Oshima &lt;<a href="mailto:michi.oshima@gmail.com" target="_blank">michi.oshima@gmail.com</a>&gt; wrote:</div></div><div><div>
<br><blockquote type="cite"><div dir="ltr">Thanks, Lucas.  I read the spec yesterday and ended up looking at disturbing auctions for 30 minutes.  I&#39;ll read it again.<div><br></div><div>Another question, is there a way to send a &quot;door bell&quot; message *in one shot* to all iOS, Android, and SimplePush variants?</div>







</div></blockquote><div><br></div></div><div>well, iOS and Android notifications aren&#39;t really doorbells,  but you can send a &quot;message&quot; to all clients that are registered in your Push Server.</div><div><br>






</div>
<div>we have a Java client </div><div><a href="http://aerogear.org/docs/guides/GetStartedwithJavaSender/" target="_blank">http://aerogear.org/docs/guides/GetStartedwithJavaSender/</a></div><div><br></div><div>and a node.js client  for this</div>







<div><a href="https://www.npmjs.org/package/aerogear-sender-client" target="_blank">https://www.npmjs.org/package/aerogear-sender-client</a></div><div><div><div><br></div><div><br></div><br><blockquote type="cite">
<div dir="ltr">
<div><br></div><div>(m:)</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 2, 2014 at 11:04 AM, 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">SimplePush works only as a &quot;door bell&quot; to tell your app,  hey,  you should go look on your server.<div>








<br></div><div>this is the spec  <a href="https://wiki.mozilla.org/WebAPI/SimplePush" target="_blank">https://wiki.mozilla.org/WebAPI/SimplePush</a></div><div><br></div><div><br></div><div><div><div><div><div>On Apr 2, 2014, at 11:02 AM, Michi Oshima &lt;<a href="mailto:michi.oshima@gmail.com" target="_blank">michi.oshima@gmail.com</a>&gt; wrote:</div>








<br></div></div><blockquote type="cite"><div><div><div dir="ltr">Hi,<div><br></div><div>Yesterday I managed to send my first message to a browser.  Thanks for all your help.</div><div><br></div><div>I&#39;ve tried sending a few different types of messages, and it so far appears to me the only thing I can send to a simple push client is a version number.  Can a simple push client receive anything else other than version numbers?  If so, what does the sender need to do, and what does the client need to do?  (If there is a good example somewhere online I can work from that also.)</div>









<div><br></div><div>My client application (javascript on browser) holds multiple types of data.  It would be nice if I can send a notification saying &quot;there&#39;s an update for this data type&quot;, rather than just &quot;there&#39;s an update&quot;.  Or, in general it&#39;d be nice if I can send more information than just a monotonically increasing number. </div>









<div><br></div><div>Here&#39;s my setup:</div><div><br></div><div><ul><li>AeroGear Push Server 0.10.0 hosted on OpenShift.<br></li><li>Sender is a JBoss app using org.jboss.aerogear.unifiedpush.JavaSender (unifiedpush-java-client-0.5.0.jar).<br>









</li><li>Client is a web browser using aerogear.js 1.4.0.<br></li></ul></div><div><br></div><div>I read <a href="http://aerogear.org/docs/specs/aerogear-push-messages/" target="_blank">this documentation</a>, but my wishful thinking refused to interpret it as saying: SimplePush variants use the &quot;extra simple-push object&quot; only.</div>









<div><br></div><div>Thank you,</div><div><br></div><div>Michi Oshima</div><div><br></div></div></div></div>
_______________________________________________<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></blockquote>








</div><br></div></div><br>_______________________________________________<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></blockquote></div><br></div>
_______________________________________________<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></blockquote>







</div></div></div><br></div><br>_______________________________________________<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></blockquote></div><br></div>
</div></div><br>_______________________________________________<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></blockquote></div></div></div><br></div></div>
<br>_______________________________________________<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></blockquote></div><br></div>
</div></div><br>_______________________________________________<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></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<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></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <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>
</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>