An example would be if a user sat their phone down with my application open and running but there had been no interactions with the application in the last ten minutes, the user should be logged out and have to sign in again. Is this a parameter that can be defined?
+1
A:
Quitting an active app, without user action/notification is considered bad form. However, if you must...
When your application starts, start a timer (NSTimer).
Instrument every method in your application to call a timer_reset function.
After 10 minutes call exit (0);
Have a look at the various NSTimer methods.
Jordan
2010-10-21 12:50:50
Calling `exit(0)` will likely cause Apple to reject your application if you submit it to the App Store.
Jon-Eric
2010-10-21 18:30:16
A:
There is no pre-defined parameter. You have to check yourself using a timer method and/or by recording the time of the last user interaction.
It's perfectly legal for an app to display its login UIView (again) after 10 minutes, but don't try to exit the app instead.
hotpaw2
2010-10-21 18:17:52