colyseus / colyseus-unity-sdk

⚔ Colyseus Multiplayer SDK for Unity
https://docs.colyseus.io/getting-started/unity-sdk/
MIT License
371 stars 102 forks source link

Unity client fails to connect on iOS (Updated for 0.14.5) #143

Closed tonygiang closed 3 years ago

tonygiang commented 3 years ago

Tested on the latest Unity client (0.14.4): When ran on an iOS device, the join room task returned by Client.JoinOrCreate always finish immediately with Faulted status. No connection attempt is received on server-side (running Colyseus 0.14.13).

When running inside Unity Editor on MacOS, Colyseus Unity client is still able to connect.

tonygiang commented 3 years ago

Just an update: I traced down exactly where the connection always fails on Unity iOS client: this line in Colyseus.Client.CreateMatchMakeRequest: 2021-05-10 12_06_37-Window req.isNetworkError will be true after this line and the function quits.

tonygiang commented 3 years ago

This issue still remains in the 0.14.5 client.

tonygiang commented 3 years ago

This turned out to be an inexplicable iOS-specific quirk. By all online documentation, setting NSAllowsArbitraryLoads in XCode's propertly list to true should allow all http connections, but for some reason, our builds refuse to acknowledge this property and we had to add our Colyseus server domain to the exception list. I'm just about fed up with Apple products. But anyway, this issue is not related to Colyseus. Closing.