iPad Adobe Air Port

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Post Reply
ktamlyn
Posts: 17
Joined: 04 Sep 2013, 16:25

iPad Adobe Air Port

Post by ktamlyn »

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!!
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: iPad Adobe Air Port

Post by Lapo »

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
Lapo
--
gotoAndPlay()
...addicted to flash games
ktamlyn
Posts: 17
Joined: 04 Sep 2013, 16:25

Re: iPad Adobe Air Port

Post by ktamlyn »

I have made much progress on this topic though suspension of the app is not perfect. Your advice helped! Thank you.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: iPad Adobe Air Port

Post by Lapo »

Thanks for your update.
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply