Application Crash after long inactivity

Post here your questions about the Objective-C API for SFS2X

Moderators: Lapo, Bax

mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Application Crash after long inactivity

Postby mmilen » 20 Jun 2012, 11:51

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.
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Re: Application Crash after long inactivity

Postby A51Integrated » 20 Jun 2012, 12:48

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.
A51 Integrated
http://a51integrated.com / +1 416-703-2300
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Re: Application Crash after long inactivity

Postby mmilen » 20 Jun 2012, 18:24

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.
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Re: Application Crash after long inactivity

Postby A51Integrated » 20 Jun 2012, 18:56

Verified and fixed. Will also be included in next release. Thanks.
A51 Integrated

http://a51integrated.com / +1 416-703-2300
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Re: Application Crash after long inactivity

Postby mmilen » 20 Jun 2012, 20:40

Thanks.
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Re: Application Crash after long inactivity

Postby A51Integrated » 22 Jun 2012, 14:30

A51 Integrated

http://a51integrated.com / +1 416-703-2300
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Re: Application Crash after long inactivity

Postby mmilen » 22 Jun 2012, 14:37

Thank you very much. Will let you know if something else comes up.

Return to “SFS2X iPhone / iPad / OSX API”

Who is online

Users browsing this forum: No registered users and 49 guests