+1 on a custom-data section.
Going even further as we add more platforms support, I think having sth like cordova push
config:
where you have platform specific section would be nice.
++
Corinne
On 21 Aug 2014, at 13:09, Erik Jan de Wit <edewit(a)redhat.com> wrote:
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(a)account.com", "someone(a)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(a)account.com", "someone(a)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
_______________________________________________
aerogear-dev mailing list
aerogear-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev