endel / NativeWebSocket

🔌 WebSocket client for Unity - with no external dependencies (WebGL, Native, Android, iOS, UWP)
Other
1.13k stars 155 forks source link

Cant Recieve JSON #8

Closed Jsennin1 closed 4 years ago

Jsennin1 commented 4 years ago

hi, im trying to send Json object from server to client ,


var sendingInfo = { timer: null, otherPlayersNameAndNumber: [] }

im getting [object object] as a debug.log on unity on websocket.OnMessage, and when i try to deserialize from JSON in OnMessage , i get error from websocket.OnError even though Json match with my class in unity. I also tried to create an object with JSON.stringify(sendingInfo) on server side and send, however this time i wont get any debug.log from OnMessage.

Edit: Opps ,sorry. by using JSON.stringify(sendingInfo) on server, looks like i was getting debug.log , just logs were messed that is why i couldnt see.