Yeah, though he was doing something like that, basically we only support key values in user-data not complex objects.

On Sat, May 14, 2016 at 5:03 AM, Matthias Wessendorf <matzew@apache.org> wrote:
yeah, here we do it: https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/push/sender/src/main/java/org/jboss/aerogear/unifiedpush/message/sender/GCMPushNotificationSender.java#L102-L107

On Fri, May 13, 2016 at 6:57 PM, Summers Pittman <supittma@redhat.com> wrote:
So I had a post on my Google+ (I know that was my reaction too) page from a user who was having trouble with UPS, user-data, and Android.  I'm not sure WHERE his problem is, but I will describe it here and we can discuss further.

Let's say we send the following to UPS using the sender API : 

{
     "message": {
"alert" : "Remote service failed. View FAQs.",
"sound": "default",
"badge": -1,
"user-data": {
"SXM": {
"CATEGORY" : "SERVICE",
"SERVICETYPE": "Remote",
"SRID": "BB4FC7F0-15E9-11E6-9F41-0050569C3256",
"APPCONTENT": "UNKNOWN",
"STATUS": "FAIL",
"STATUSCHANGE_DATETIME": "UNKNOWN",
"URL": "XYZABC.com"
}
}
     }
   }

Android will receive the following message bundle from Google : 

Bundle[
  {aerogear-push-id=3f2b9477-fc9e-463a-94d7-d62bf55706e1, 
   SXM={CATEGORY=SERVICE, SERVICETYPE=Remote, SRID=BB4FC7F0-15E9-11E6-9F41-0050569C3256, APPCONTENT=UNKNOWN, STATUS=FAIL, STATUSCHANGE_DATETIME=UNKNOWN, URL=XYZABC.com}, 
   alert=Remote service failed. View FAQs., 
   badge=-1, 
   sound=default,  
   collapse_key=do_not_collapse}
]

As we can see, several things have happened.  1) user-data has been rolled up into a root element, and the SXM root object's JSON body has been stripped of its jsonness.  IDEALLY we would be able to keep the body of userdata as a string for user's to handle themselves.  

I THINK this is an issue with how UPS converts the message for sending to GCM, but i haven't researched that far.

Summers

_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--

_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--
Cheers,
       Erik Jan