[aerogear-dev] message format change proposal

Erik Jan de Wit edewit at redhat.com
Thu Aug 21 07:09:41 EDT 2014


Hi,

With the upcoming windows support and simple push change (making simple push more like 'normal') the number of ‘special’ keys in our message is increasing. Right now we are mixing our ‘special’ keys with those the user can add, but we keep simple push out of it:

{
       "variants" : ["c3f0a94f-48de-4b77-a08e-68114460857e", "444939cd-ae63-4ce1-96a4-de74b77e3737" ....],
       "alias" : ["user at account.com", "someone at aerogear.org", ....],
       "categories" : ["someCategory", "otherCategory"],
       "deviceType" : ["iPad", "AndroidTablet"],
       "ttl" : 3600,
       "message": {
         "alert":"HELLO!",
         "sound":"default",
         "badge":7,
         "content-available" : true,
         "action-category" : "some_category",
         
         "someKey":"some value",
         "anotherCustomKey":"some other value"
       },
"simple-push": "version=123”
}


As simple push is going to be more like ‘normal’ push why not move the simple-push into the message as well. As for the windows support there are a lot more types of messages you can send. The most normal form is called ‘toast’, but there are other ones for when you app is pinned to the home screen. Then one can send message that contain pictures. To support all of this we need something like this: https://gist.github.com/edewit/305d76c31960aa6254a9

Adding all these ‘special’ keys will make it easier to get into a conflict with the users own data, so I propose we put the user data into a separate data object, like so:

{
       "variants" : ["c3f0a94f-48de-4b77-a08e-68114460857e", "444939cd-ae63-4ce1-96a4-de74b77e3737" ....],
       "alias" : ["user at account.com", "someone at aerogear.org", ....],
       "categories" : ["someCategory", "otherCategory"],
       "deviceType" : ["iPad", "AndroidTablet"],
       "ttl" : 3600,
       "message": {
         "alert":"HELLO!",
         "sound":"default",
         "badge":7,
         "content-available" : true,
         "action-category" : "some_category",
         "simple-push": "version=123",
         "data" : {
             "someKey":"some value",
             "anotherCustomKey":"some other value"
            }
       }
}


WDYT?

Cheers,
	Erik Jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20140821/6fe9681c/attachment-0001.html 


More information about the aerogear-dev mailing list