[aerogear-dev] UnifiedPush: API for sending notifications to SimplePush clients/channels

Matthias Wessendorf matzew at apache.org
Thu Oct 24 12:40:05 EDT 2013


Hi,

for my upcoming work on
AGPUSH-320<https://issues.jboss.org/browse/AGPUSH-320> I
did think a bit about our current API, especially how the SimplePush part
is looking today...

When sending a (SimplePush) notification via the UnifiedPush today it looks
like:

curl -3 -u "{PushApplicationID}:{MasterSecret}"
   -v -H "Accept: application/json" -H "Content-type: application/json"
   -X POST
   -d '{
       "simple-push": {
         "SomeCategory":"version=123",
         "anotherCategory":"version=456"
       }
     }'
https://SERVER:PORT/CONTEXT/rest/sender

This (currently) implies the fact that only *one* 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:

"simple-push": {
  "european_financialNews":"version=456",
  "earthquake_bayarea":"version=789"
}

A mix like that will not happen, I'd assume... But for me the point is...
it really does not make sense to send a few notifications for *totally
different* channels, on *ONE* request...

This is similar to something like where you send *ONE* notification to two
(or more) totally different native apps (e.g. weatherApp-iOS andWhatsApp).

Not sure what kinda back that really wants
<https://github.global.ssl.fastly.net/images/icons/emoji/smile.png>

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):

curl -3 -u "{PushApplicationID}:{MasterSecret}"
   -v -H "Accept: application/json" -H "Content-type: application/json"
   -X POST
   -d '{
       "category" : ["German Bundesliga", "UEFA ChampionsLeague"],
       "message": {
         "alert":"Goal by Marco Reus!",
         "sound":"default"
       },
       "simple-push": "version=someVersionNumberString"
     }'

https://SERVER:PORT/CONTEXT/rest/sender

The simple-push key just takes the *version=FOO* thing (or maybe just the
versionNumberString...), instead of submitting a map, where we pass *
different* versions for *different* channels.

The rest is pretty much similar to what we already do today (at least for
Android/iOS):

   - We apply some criteria (sure *this* example already has multiple
   categories...)
   - Based on the different criteria we find all the *Installations* (==
   devices/connected clients) we want.

*Note:* 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)

Any thoughts ?

-Matthias

-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20131024/9d44aab1/attachment.html 


More information about the aerogear-dev mailing list