[aerogear-dev] Unified Push, user-data field and Android push

Summers Pittman supittma at redhat.com
Fri May 13 12:57:27 EDT 2016


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20160513/ac66ebb6/attachment.html 


More information about the aerogear-dev mailing list