itisnajim / SocketIOUnity

A Wrapper for socket.io-client-csharp to work with Unity.
MIT License
393 stars 67 forks source link

Emit not work on Android and IOS #12

Closed dongnhdongnh closed 2 years ago

dongnhdongnh commented 2 years ago

it worked fine on editor but on Android and IOS emit not work

vitalii-vorobiov commented 2 years ago

I have the same issue. The library works perfect in Unity Editor, but when ported to the Android device (ARM64) the Emit function doesn't work. Android client is able to connect to the server, but it cannot Emit messages and also no errors are thrown.

itisnajim commented 2 years ago

just the Emit? is the receiving good?

try in the play settings -> player -> Other settings -> Configuration to select IL2CPP as a Scripting Backend, and .NET 4.x as API Compatibility Settings,

and watch the app debug in the Android Studio or Xcode for more info!

vitalii-vorobiov commented 2 years ago

Yeah, the problem is just with the Emit, the receiving works perfectly.

The project is already using IL2CPP, .Net 4.X. Emit still doesn't work on Android device. I've also debugged in the Android Studio and the Emit function is called, but on the server side there is no message. I thought that maybe the issue is with a server, but when I Emit messages from the Unity Editor server receives them.

itisnajim commented 2 years ago

maybe is a server problem check these: https://github.com/doghappy/socket.io-client-csharp/issues/134 https://github.com/doghappy/socket.io-client-csharp/issues/120

itisnajim commented 2 years ago

or from the client, maybe you should add some permissions

like internet for android

<manifest xlmns:android...>
 ...
 <uses-permission android:name="android.permission.INTERNET" />
 <application ...
</manifest>

for ios maybe this the prob.. transport security has blocked-a cleartext http

i can't help with no more context or info ...

itisnajim commented 2 years ago

maybe related? https://github.com/itisnajim/SocketIOUnity/issues/19

this will be closed due to inactivity.