<div dir="ltr">This change makes totally sense for me , so I&#39;m +1<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 24, 2013 at 6:40 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p style="line-height:22.727272033691406px;margin-right:0px;font-size:15.454545021057129px;margin-left:0px;margin-bottom:15px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px!important">

Hi,</p><p style="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">for my upcoming work on <a href="https://issues.jboss.org/browse/AGPUSH-320" rel="noreferrer" style="color:rgb(65,131,196);text-decoration:none" target="_blank">AGPUSH-320</a> I did think a bit about our current API, especially how the SimplePush part is looking today...</p>

<p style="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">When sending a (SimplePush) notification via the UnifiedPush today it looks like:</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;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:normal;margin:0px;padding: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">curl -3 -u &quot;{PushApplicationID}:{MasterSecret}&quot;
   -v -H &quot;Accept: application/json&quot; -H &quot;Content-type: application/json&quot; 
   -X POST
   -d &#39;{
       &quot;simple-push&quot;: {
         &quot;SomeCategory&quot;:&quot;version=123&quot;,
         &quot;anotherCategory&quot;:&quot;version=456&quot;
       }
     }&#39;
https://SERVER:PORT/CONTEXT/rest/sender
</code></pre><p style="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">This (currently) implies the fact that only <em>one</em> category is possible, per channel/device (will change, as mentioned in above JIRA). But... I think this can lead to some really stupid use-case:</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;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:normal;margin:0px;padding: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">&quot;simple-push&quot;: {
  &quot;european_financialNews&quot;:&quot;version=456&quot;,
  &quot;earthquake_bayarea&quot;:&quot;version=789&quot;
}
</code></pre><p style="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">A mix like that will not happen, I&#39;d assume... But for me the point is... it really does not make sense to send a few notifications for <em>totally different</em> channels, on <em>ONE</em> request... <br>

<br>This is similar to something like where you send <em>ONE</em> notification to two (or more) totally different native apps (e.g. <code style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:normal;margin:0px 2px;padding:0px 5px;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;white-space:nowrap">weatherApp-iOS</code> and<code style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:normal;margin:0px 2px;padding:0px 5px;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;white-space:nowrap">WhatsApp</code>). <br>

<br>Not sure what kinda back that really wants <a href="https://github.global.ssl.fastly.net/images/icons/emoji/smile.png" style="color:rgb(65,131,196);text-decoration:none" target="_blank"><img height="20" width="20" style="border:0px;max-width:100%"></a></p>

<p style="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">My suggestion is to change the API a bit, and make it more like we treat the native Android/iOS clients (besides the version limitation from SimplePush):</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;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:normal;margin:0px;padding: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">curl -3 -u &quot;{PushApplicationID}:{MasterSecret}&quot;
   -v -H &quot;Accept: application/json&quot; -H &quot;Content-type: application/json&quot; 
   -X POST
   -d &#39;{
       &quot;category&quot; : [&quot;German Bundesliga&quot;, &quot;UEFA ChampionsLeague&quot;],
       &quot;message&quot;: {
         &quot;alert&quot;:&quot;Goal by Marco Reus!&quot;,
         &quot;sound&quot;:&quot;default&quot;
       },
       &quot;simple-push&quot;: &quot;version=someVersionNumberString&quot;
     }&#39;

https://SERVER:PORT/CONTEXT/rest/sender
</code></pre><p style="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">The <code style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:normal;margin:0px 2px;padding:0px 5px;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;white-space:nowrap">simple-push</code> key just takes the <em>version=FOO</em> thing (or maybe just the versionNumberString...), instead of submitting a map, where we pass <em>different</em> versions for <em>different</em> channels.</p>

<p style="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">The rest is pretty much similar to what we already do today (at least for Android/iOS):</p>

<ul style="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px;padding:0px 0px 0px 30px"><li>We apply some criteria (sure <i><b>this</b></i> example already has multiple categories...)</li>

<li>Based on the different criteria we find all the <em>Installations</em> (== devices/connected clients) we want.</li></ul><p style="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">

<em><strong>Note:</strong></em> If no criteria has been specified, we deliver the message (for SP the given version) to all installations of all registered variants... (like we do it already today)</p><p style="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">

Any thoughts ?</p><span class="HOEnZb"><font color="#888888"><p style="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">-Matthias</p><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>
</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>