Closed mdhanif-simformsolutions closed 1 month ago
Describe the bug I am trying to send a json object to my server something like this :-
val jsonObject = JsonObject() jsonObject.addProperty("domain", "test") jsonObject.addProperty("type", "test") jsonObject.addProperty("bearer", "test") mSocket?.emit("subscribe", jsonObject)
But when I see the logs what it sends is :- ["subscribe","{\"domain\":\"test\",\"type\":\"test\",\"bearer\":\"test\"}"]
["subscribe","{\"domain\":\"test\",\"type\":\"test\",\"bearer\":\"test\"}"]
Instead It should be :- ["subscribe",{"domain":"test","type":"test","bearer":"test"]
["subscribe",{"domain":"test","type":"test","bearer":"test"
Not sure why is it being strigified here ?
To Reproduce
mSocket?.connect()
mSocket?.emit()
Socket.IO server version: 2.2.0
2.2.0
Socket.IO java client version: 1.0.2
1.0.2
Expected behavior Json Object should be send as it is instead of being converted to string
Additional context In iOS it works good but seems something is missing in android
Hi! Which JsonObject are you using? The one from org.json?
JsonObject
org.json
Closed due to inactivity, please reopen if needed.
Describe the bug I am trying to send a json object to my server something like this :-
But when I see the logs what it sends is :-
["subscribe","{\"domain\":\"test\",\"type\":\"test\",\"bearer\":\"test\"}"]
Instead It should be :-
["subscribe",{"domain":"test","type":"test","bearer":"test"
]Not sure why is it being strigified here ?
To Reproduce
mSocket?.connect()
to establish a proper socket connection which works goodmSocket?.emit()
to emit the data with json object which is being stringifiedSocket.IO server version:
2.2.0
Socket.IO java client version:
1.0.2
Expected behavior Json Object should be send as it is instead of being converted to string
Additional context In iOS it works good but seems something is missing in android