Testing Testing
Testing Testing

Reputation: 37

logout user if does not touch app for 20 min

I want to logout a login user from ipad application if he does not do any thing on app for 20 min. how i can achieve this. I tried

- (void)applicationWillResignActive:(UIApplication *)application

this method but no success.

Additional information: I don't want to terminate, just want to call a method in which I will write code to log out.

Upvotes: 2

Views: 176

Answers (1)

zaph
zaph

Reputation: 112857

Use an NSTImer set to 20 minutes with a target of your logout method and reset it each time there is activity.

+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)seconds target:(id)target selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)repeats

Upvotes: 3

Related Questions