<div dir="ltr">Hi <span style="font-family:arial,sans-serif;font-size:13px">Michi, </span><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">just wanted to chime in that the SimplePush server does support multiple registrations like Seb has described. If your clients have WebSocket support there will only be a single WebSocket connection and messages will flow over it. You can see the information that is returned from a registration here [1], and the format of the notification is described here [2].</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">If you&#39;d like to verify the behaviour of the SimplePush Server there is a very basic client that I use for manual testing which you can try[3]. Using your browsers debug utilities you should be able to inspect the WebSocket frames and hence the information in the registrations and notifications.</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">Hope this helps. Let us know if you have any other questions. </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">Regards,</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">/Dan</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">[1] </span><font face="arial, sans-serif"><a href="https://github.com/aerogear/aerogear-simplepush-server/tree/master/server-core#register">https://github.com/aerogear/aerogear-simplepush-server/tree/master/server-core#register</a></font><span style="font-family:arial,sans-serif;font-size:13px"> </span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">[2] </span><font face="arial, sans-serif"><a href="https://github.com/aerogear/aerogear-simplepush-server/tree/master/server-core#notification">https://github.com/aerogear/aerogear-simplepush-server/tree/master/server-core#notification</a></font></div>
<div><font face="arial, sans-serif">[3] <a href="https://github.com/aerogear/aerogear-simplepush-server/tree/master/server-netty#python-webserver">https://github.com/aerogear/aerogear-simplepush-server/tree/master/server-netty#python-webserver</a></font></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 4 April 2014 10:02, 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 class="HOEnZb"><div class="h5"><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><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>