Hello,
I am having a problem that I am hoping someone can help me solve… Some background: I am developing a Unity game on iOS where the gameplay is run on a remote server. To talk to this server during gameplay, I keep a persistent TCP connection open to it (using the standard .Net TcpClient class).
When the user presses the home button on their iPhone or iPad, the desired behavior is that a message will be sent to the server telling it to pause the game. (Otherwise the game will simply keep running on the server even though the game on the device has been paused!)
My issue is that, when the user presses the home button on their device, iOS appears to halt all outgoing data until the application is unpaused, at which point any messages that were sent after the app was paused are finally delivered. I am sending the message as soon as OnApplicationPause is called, and even manually Flush()ing the socket connection before OnApplicationPause returns, but the message isn’t received on the server until the app is unpaused by the player.
Does anyone know how to solve or work around this issue? I am open to purchasing a 3rd-party plugin if that’s necessary.
Thanks!!
Walt