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!

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    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 get OnLeftRoom 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.
  • Cyb
    Options
    Hi @JohnTube!

    As far as I understand it is a FallbackSendAckThread method. It would be much easier if disconnect event informs about such situation. Ok, after all I have to handle OnApplicationPause by myself.

    Thanks!