2

I want to do something like this for my app.

User selects a lockAppAfter some minutes you say 1,2,5,10 like that and if user is doing nothing then device should enter in idle mode as per user selected time. Is it possible to control device's idel timer?

Rahul Vyas
  • 28,260
  • 49
  • 182
  • 256

1 Answers1

3

You can disable it via

[[UIApplication sharedApplication] setIdleTimerDisabled:YES];

So if you want to have a timeout for that you can create a NSTimer and fire this method to control it.

Praveen S
  • 10,355
  • 2
  • 43
  • 69
  • I know this method already. How can I get lock screen after 10 minutes? – Rahul Vyas Aug 02 '11 at 07:19
  • I think you can set the timer disabled initially and create a timer for 10 min and disable it. – Praveen S Aug 02 '11 at 07:21
  • refer http://stackoverflow.com/questions/832940/programmatically-lock-and-unlock-screen-of-iphone – Maulik Aug 02 '11 at 07:22
  • I want my timer like this suppose I fire a NSTimer to lock after 10 minutes and then device is idle for ten minutes then it should show lock screen otherwise if user do something then timer should be invalidated again if device is idle for 10 minutes then it should show lock screen. Can you provide some brief explanation? – Rahul Vyas Aug 03 '11 at 13:23