Disconnecting From Server When in Background iPhone

Options
Hi, I am experiencing an issue with a turn-based game that I built using Photon Server SDK and Javascript SDK(used to connect the Client to Photon Server) on iPhone.
Whenever in iPhone my app goes in the background and it comes in Foreground even within 5 seconds It gets disconnected from the server and the whole app freezes.
Sometimes it does get reconnected after 10-15 seconds sometimes we have to close the app completely and then reopen it to join back into the room.
I need suggestions on the following:
1. Is there a parameter or a value that we can increase so that player gets disconnected after some more time.
2. How can I detect that player is disconnected from Javascript SDK and how can I make a reconnect request as soon as app comes in the foreground.
3. Can I prevent the app from disconnecting when It goes in the background in iPhone

Thanks

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Shivendra,

    Thank you for choosing Photon!

    This is a known issue yes.

    The timeout disconnect interval should be 10 seconds.

    1. Yes see here. Not sure how to set timeout value in JavaScript client though.
    2. @vadim can answer here.
    3. Not possible. This is by design in iPhone.