Page 1 of 1

Application Crash after long inactivity

Posted: 20 Jun 2012, 11:51
by mmilen
Terminating app due to uncaught exception 'SFSException', reason: 'User should be joined in a room in order to send a public message'


The situation is most likely for two players at the same location (home):
players were joined in a table.
players left the iPads for long period of time.
naturally the iPad locks it self after a while and after a little longer it will turn WiFi off.
Now both users are disconnected from the server.
One player turns on the iPad and tries to send a publicMessage. App Crashes with the above error.

Re: Application Crash after long inactivity

Posted: 20 Jun 2012, 12:48
by A51Integrated
You should use the applicationDidBecomeActive: method to check for connectivity first. Once in the background, the app stops executing code and it's connection to SFS will be lost. Because it doesn't execute code, there's no way for it to react to a lost connection. So the best way to work around the issue is the have some logic in applicationDidBecomeActive: that either reconnects the user to the last known zone and room or alert the user that they have been disconnected.

Re: Application Crash after long inactivity

Posted: 20 Jun 2012, 18:24
by mmilen
Definitely I have no problem handling the comeback from background. Never the less SFSclient should send some general onErrorAlert, rather than just crash the app. The older source Code base API does not crash the app.

Re: Application Crash after long inactivity

Posted: 20 Jun 2012, 18:56
by A51Integrated
Verified and fixed. Will also be included in next release. Thanks.

Re: Application Crash after long inactivity

Posted: 20 Jun 2012, 20:40
by mmilen
Thanks.

Re: Application Crash after long inactivity

Posted: 22 Jun 2012, 14:30
by A51Integrated

Re: Application Crash after long inactivity

Posted: 22 Jun 2012, 14:37
by mmilen
Thank you very much. Will let you know if something else comes up.