Unity + Android + disconnect whilst phone in the sleep mode
Options
Hello,
If I put an android device into sleep mode approx after 1 min the local player leaves the room. I've got callback 'OnLeftRoom' and then 'OnDisconnectedFromPhoton', but not 'OnConnectionFail'. Is it correct? How can I handle such situation to keep player in the room?
Thanks in advance!
If I put an android device into sleep mode approx after 1 min the local player leaves the room. I've got callback 'OnLeftRoom' and then 'OnDisconnectedFromPhoton', but not 'OnConnectionFail'. Is it correct? How can I handle such situation to keep player in the room?
Thanks in advance!
0
Comments
-
Hi @Cyb,
Thank you for choosing Photon!
Yes, those callbacks are expected because you were joined to a room when the app went to background. You should not getOnLeftRoom
if you were not joined.
There is a background timeout option in PUN that indicates how long the background thread should keep sending ACKs to server to keep it connected. After the timeout the client automatically disconnects gracefully instead of getting timeout disconnect.
0