I have a game that works for desktop, as well as the iPad. The problem I'm trying to tackle however on the iPad is the scenario when a user leaves the game app with the home button, then allows the iPad screen to timeout within an app I have no control over.
The problem is that upon return to the game app SFS has lost connection to the server due to the iOS app suspension. The user is no longer connected. Do you have any suggestions on how to handle this?
I could see capturing an "awake event" in which the app looks to see if its still connected to the server, and if not connected I could require the user to log back in. Is this possible?
If that is not possible, how does SFS handle the situation? Does it just become a zombie since its been disconnected for many minutes?
Thanks!!
iPad Adobe Air Port
Re: iPad Adobe Air Port
Hi,
there could be a number of options.
Is it possible from the Air application, while in background mode, to keep doing something? If so you could set up a timer that sends an empty Extension request to keep the connection alive. 1 packet every 30 sec, for example. I am pretty sure you can detect when the App enters or leaves background mode and start/stop the timer.
Another idea is to detect the reason of the disconnection, which in this case it will be "Idle" and bring the user back to the login screen, or if you store his login credentials in memory you can re-connect and login automatically without any user input.
If you decide for the latter make sure you re-create the SmartFox object when you start the new connection.
cheers
there could be a number of options.
Is it possible from the Air application, while in background mode, to keep doing something? If so you could set up a timer that sends an empty Extension request to keep the connection alive. 1 packet every 30 sec, for example. I am pretty sure you can detect when the App enters or leaves background mode and start/stop the timer.
Another idea is to detect the reason of the disconnection, which in this case it will be "Idle" and bring the user back to the login screen, or if you store his login credentials in memory you can re-connect and login automatically without any user input.
If you decide for the latter make sure you re-create the SmartFox object when you start the new connection.
cheers
Re: iPad Adobe Air Port
I have made much progress on this topic though suspension of the app is not perfect. Your advice helped! Thank you.