[Aerogear-users] Message posted through RestAPI does not show up as JSON in Android

vvalluru vvalluru at hotmail.com
Fri May 13 11:14:53 EDT 2016


We are using Unified Push server 1.1.0 final
We created a format for message, which we want to post to our Android and
iOS users. Message has some userData. On iOS, data shows up fine as a proper
JSON, however, for android, the data shows as a string. 

Any Suggestions would be very helpful.
Thanks
Vish

The message submitted is submitted like this:
{ "message": {
"alert" : "Remote service failed. View FAQ's.",
"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"}},
"apns": {"action-category": "Service"}},
criteria:
{"alias": ["A337544939901E078A3C7DF1435DFD0B"]}
}


Android receives message like this:
{aerogear-push-id=4d8ea259-ad94-49f0-b470-50fc4bcf3a20, 
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 FAQ's., 
badge=-1, 
sound=default, 
collapse_key=do_not_collapse
}


If we remove the SXM tag under userData, issue remains the same:

Android receives message like this:
{aerogear-push-id=4d8ea259-ad94-49f0-b470-50fc4bcf3a20, 
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 FAQ's.,
collapse_key=do_not_collapse
}




--
View this message in context: http://aerogear-users.1116366.n5.nabble.com/Message-posted-through-RestAPI-does-not-show-up-as-JSON-in-Android-tp661.html
Sent from the aerogear-users mailing list archive at Nabble.com.


More information about the Aerogear-users mailing list