Open Kouznetsov opened 1 year ago
duplicated ? https://github.com/itisnajim/SocketIOUnity/issues/12
I don't think so, the server is working fine. The same thing happens on iOS. Login and message receiving are working but nothing gets emitted. No error is raised either. The other thread suggests that android might be missing the internet permission but my game already uses internet without problem.
It might be related to the fact that my server is not running on https. The thing that's weird is that it still connects and receives messages. I expected everything to fail directly.
try these: https://github.com/doghappy/socket.io-client-csharp/issues/134 https://github.com/doghappy/socket.io-client-csharp/issues/129 https://github.com/doghappy/socket.io-client-csharp/issues/120 https://github.com/doghappy/socket.io-client-csharp/issues/113 https://github.com/doghappy/socket.io-client-csharp/issues/24 https://github.com/doghappy/socket.io-client-csharp/issues/5
and try to emit an empty event, something like:
socket.Emit("eventName");
or different (player )build settings!
also build on pc/mac and see if this is only on android !? sometimes restarting the app can fix this if you are working on localhost or in a local network.
try updating unity see https://github.com/itisnajim/SocketIOUnity/issues/36
For me this was caused by IL2CPP breaking the JSON serializer that is used by default.
Simply switching to the Newtonsoft option (that's already included) makes Emit
work on Android and iOS.
using SocketIOClient.Newtonsoft.Json;
socket = new SocketIOUnity( ... );
socket.JsonSerializer = new NewtonsoftJsonSerializer();
For me this was caused by IL2CPP breaking the JSON serializer that is used by default. Simply switching to the Newtonsoft option (that's already included) makes
Emit
work on Android and iOS.
using SocketIOClient.Newtonsoft.Json;
socket = new SocketIOUnity( ... ); socket.JsonSerializer = new NewtonsoftJsonSerializer();
it's works thanks
The
socket.Emit()
function works correctly on the Editor. My android device receives the messages as expected, but when Emitting from android, nothing shows on the server or elsewhere. The code is the same on the Editor and the Android device.