- Home /
Cannot connect via remote when screen is turned off and on?
Hi, I'm trying to use Unity's UnityEngine.Networking.PlayerConnection to connect to an iOS device. Connection works fine until I turn the screen off and on. After this, the phone doesn't register a disconnection, but the editor does. I found another way to register the disconnection, in my case using the ARSessionInterruptedEvent event, but even if it's disconnected first, I can't reconnect to the phone app anymore.
Here's how the flow goes:
I start the app
I connect to the app via the console
I turn off the screen
I turn on the screen
After turning on the screen, the editor connection closes
I try to connect to the phone again, but I get an error saying "Failed to connect to player"
Something is not allowing future connections, but my question is what, and how do you fix this, if possible?
Current solution is restarting the app. I also tried reloading the scene when the game was paused and afterwards OnApplicationFocus was called, but this doesn't work. I also tried having Application.runInBackground = true, but this didn't work either.
Your answer
Follow this Question
Related Questions
What exactly can you can and can't you do when developing for iOS on Windows 1 Answer
Unity Remote 4 Orientation 0 Answers
Remote iOS build from Windows to iPhone on Windows 0 Answers
VideoPlayer problem with iOS build 0 Answers
Unity iOS sdk question 1 Answer