Message posted through RestAPI does not show up as JSON in Android

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Message posted through RestAPI does not show up as JSON in Android

vvalluru
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
}
Loading...